def init_simple_stream_logging(level=logging.INFO, streams=None, format=None, date_format=None):
 if (not streams):
  streams = [sys.stdout]
 if (not format):
  format = '%(asctime)s %(message)s'
 if (not date_format):
  date_format = '%H:%M:%S'
 logging.basicConfig(level=level)
 handlers = []
 formatter = WrappingLogFormatter(format=format, date_format=date_format)
 for stream in streams:
  log_handler = logging.StreamHandler(stream)
  log_handler.setLevel(level)
  log_handler.setFormatter(formatter)
  handlers += [log_handler]
 logging.getLogger('').handlers = handlers

def init_simple_stream_logging ( level = logging . INFO , streams = None , format = None , date_format = None ) : if ( not streams ) : streams = [ sys . stdout ] if ( not format ) : format = '%(asctime)s %(message)s' if ( not date_format ) : date_format = '%H:%M:%S' logging . basicConfig ( level = level ) handlers = [ ] formatter = WrappingLogFormatter ( format = format , date_format = date_format ) for stream in streams : log_handler = logging . StreamHandler ( stream ) log_handler . setLevel ( level ) log_handler . setFormatter ( formatter ) handlers += [ log_handler ] logging . getLogger ( '' ) . handlers = handlers
useful for simple command-line tools .