def LogInit():
  logging.debug("Initializing Logging subsystem.")

  if flags.FLAGS.verbose:
    # verbose flag just sets the logging verbosity level.
    config_lib.CONFIG.AddContext(
        "Debug Context",
        "This context is to allow verbose and debug output from "
        "the binary.")

  # The root logger.
  logger = logging.getLogger()
  memory_handlers = [m for m in logger.handlers
                     if m.__class__.__name__ == "PreLoggingMemoryHandler"]

  # Clear all handers.
  logger.handlers = list(GetLogHandlers())
  SetLogLevels()

  # Now flush the old messages into the log files.
  for handler in memory_handlers:
    for record in handler.buffer:
      logger.handle(record)
Configure the logging subsystem.
dataset/ETHPy150Open google/grr/grr/lib/log.py/LogInit