def initlog(*allargs):
 global logfp, log
 if (logfile and (not logfp)):
  try:
   logfp = open(logfile, 'a')
  except IOError:
   pass
 if (not logfp):
  log = nolog
 else:
  log = dolog
 log(*allargs)

def initlog ( * allargs ) : global logfp , log if ( logfile and ( not logfp ) ) : try : logfp = open ( logfile , 'a' ) except IOError : pass if ( not logfp ) : log = nolog else : log = dolog log ( * allargs )
write a log message .