def configure_custom(debug=False, stdout=None, stderr=None):
 top_level_logger = logging.getLogger(__name__.split('.')[0])
 top_level_logger.propagate = False
 top_level_logger.setLevel((logging.DEBUG if debug else logging.INFO))
 while top_level_logger.handlers:
  top_level_logger.handlers.pop()
 fmt = CustomFormatter()
 handler = CustomStreamHandler(stdout=stdout, stderr=stderr, formatter=fmt)
 top_level_logger.addHandler(handler)

def configure_custom ( debug = False , stdout = None , stderr = None ) : top_level_logger = logging . getLogger ( __name__ . split ( '.' ) [ 0 ] ) top_level_logger . propagate = False top_level_logger . setLevel ( ( logging . DEBUG if debug else logging . INFO ) ) while top_level_logger . handlers : top_level_logger . handlers . pop ( ) fmt = CustomFormatter ( ) handler = CustomStreamHandler ( stdout = stdout , stderr = stderr , formatter = fmt ) top_level_logger . addHandler ( handler )
configure the logging module to output logging messages to the console via stdout and stderr .