def basicConfig(**kwargs):
 if (len(root.handlers) == 0):
  filename = kwargs.get('filename')
  if filename:
   mode = kwargs.get('filemode', 'a')
   hdlr = FileHandler(filename, mode)
  else:
   stream = kwargs.get('stream')
   hdlr = StreamHandler(stream)
  fs = kwargs.get('format', BASIC_FORMAT)
  dfs = kwargs.get('datefmt', None)
  fmt = Formatter(fs, dfs)
  hdlr.setFormatter(fmt)
  root.addHandler(hdlr)
  level = kwargs.get('level')
  if (level is not None):
   root.setLevel(level)

def basicConfig ( ** kwargs ) : if ( len ( root . handlers ) == 0 ) : filename = kwargs . get ( 'filename' ) if filename : mode = kwargs . get ( 'filemode' , 'a' ) hdlr = FileHandler ( filename , mode ) else : stream = kwargs . get ( 'stream' ) hdlr = StreamHandler ( stream ) fs = kwargs . get ( 'format' , BASIC_FORMAT ) dfs = kwargs . get ( 'datefmt' , None ) fmt = Formatter ( fs , dfs ) hdlr . setFormatter ( fmt ) root . addHandler ( hdlr ) level = kwargs . get ( 'level' ) if ( level is not None ) : root . setLevel ( level )
do basic configuration for the logging system .