def log_line(filename, line):
 global _open_log_files, _log_file_dir
 path = get_path(_log_file_dir, filename)
 if (path not in _open_log_files):
  close_log_file(filename)
  try:
   os.makedirs(os.path.dirname(path))
  except OSError:
   pass
  _open_log_files[path] = open(path, 'w')
 timestr = time.strftime('%Y-%m-%d %H:%M:%S')
 _open_log_files[path].write(('%s: %s\n' % (timestr, line)))
 _open_log_files[path].flush()

def log_line ( filename , line ) : global _open_log_files , _log_file_dir path = get_path ( _log_file_dir , filename ) if ( path not in _open_log_files ) : close_log_file ( filename ) try : os . makedirs ( os . path . dirname ( path ) ) except OSError : pass _open_log_files [ path ] = open ( path , 'w' ) timestr = time . strftime ( '%Y-%m-%d %H:%M:%S' ) _open_log_files [ path ] . write ( ( '%s: %s\n' % ( timestr , line ) ) ) _open_log_files [ path ] . flush ( )
write a line to a file .