def startlog(self, filename, overwrite=True):
if not filename:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>if overwrite:<EOL><INDENT>_mode = '<STR_LIT:w>'<EOL><DEDENT>else:<EOL><INDENT>_mode = '<STR_LIT:a>'<EOL><DEDENT>self._file_logger = self.logging.FileHandler(os.path.expanduser(filename), _mode)<EOL>_formatter = self.logging.Formatter('<STR_LIT>')<EOL>self._file_logger.setFormatter(_formatter)<EOL>self.logger.addHandler(_file_logger)<EOL>if _ldtp_debug:<EOL><INDENT>self._file_logger.setLevel(logging.DEBUG)<EOL><DEDENT>else:<EOL><INDENT>self._file_logger.setLevel(logging.ERROR)<EOL><DEDENT>return <NUM_LIT:1><EOL>
@param filename: Start logging on the specified file
@type filename: string
@param overwrite: Overwrite or append
    False - Append log to an existing file
    True - Write log to a new file. If file already exist, 
    then erase existing file content and start log
@type overwrite: boolean

@return: 1 on success and 0 on error
@rtype: integer