Initializes the Application logging.
326344
def _initialize_logging():
    

    # Starting the console handler if a terminal is available.
    if sys.stdout.isatty() or platform.system() in ("Darwin", "Linux"):
        RuntimeGlobals.logging_console_handler = foundations.verbose.get_logging_console_handler()

    # Defining logging formatters.
    RuntimeGlobals.logging_formatters = {"Default": foundations.verbose.LOGGING_DEFAULT_FORMATTER,
                                         "Extended": foundations.verbose.LOGGING_EXTENDED_FORMATTER,
                                         "Standard": foundations.verbose.LOGGING_STANDARD_FORMATTER}
1300941
def _init_logger(self):
        
        if self.flow:
            self.logger = self.flow.logger.getChild(self.__class__.__name__)
        else:
            self.logger = logging.getLogger(__name__)
216880
def Init():
  """"""
  global INIT_RAN
  if INIT_RAN:
    return

  # Set up a temporary syslog handler so we have somewhere to log problems
  # with ConfigInit() which needs to happen before we can start our create our
  # proper logging setup.
  syslog_logger = logging.getLogger("TempLogger")
  if os.path.exists("/dev/log"):
    handler = logging.handlers.SysLogHandler(address="/dev/log")
  else:
    handler = logging.handlers.SysLogHandler()
  syslog_logger.addHandler(handler)

  try:
    config_lib.SetPlatformArchContext()
    config_lib.ParseConfigCommandLine()
  except config_lib.Error:
    syslog_logger.exception("Died during config initialization")
    raise

  metric_metadata = server_metrics.GetMetadata()
  metric_metadata.extend(communicator.GetMetricMetadata())

  stats_collector = prometheus_stats_collector.PrometheusStatsCollector(
      metric_metadata, registry=prometheus_client.REGISTRY)
  stats_collector_instance.Set(stats_collector)

  server_logging.ServerLoggingStartupInit()

  bs_registry_init.RegisterBlobStores()
  all_decoders.Register()
  all_parsers.Register()
  registry.Init()

  # Exempt config updater from this check because it is the one responsible for
  # setting the variable.
  if not config.CONFIG.ContextApplied("ConfigUpdater Context"):
    if not config.CONFIG.Get("Server.initialized"):
      raise RuntimeError("Config not initialized, run \"grr_config_updater"
                         " initialize\". If the server is already configured,"
                         " add \"Server.initialized: True\" to your config.")

  INIT_RAN = True
1238209
def init_logging(verbose=False, format='%(asctime)s %(message)s'):
    
    def sig_handler(signum, frame):
        logger = logging.getLogger()
        log_level = logger.level
        if log_level == logging.DEBUG:
            log_level = logging.WARN
        else:
            log_level = logging.DEBUG
        logging.warn('Got signal %d, setting log level to %d',
                     signum, log_level)
        logger.setLevel(log_level)

    signal.signal(signal.SIGUSR1, sig_handler)

    if verbose:
        initial_level = logging.DEBUG
    else:
        initial_level = logging.WARN
    logging.getLogger().setLevel(initial_level)
    logging.basicConfig(format=format, level=initial_level)
534110
private static void initializeLogFactory() {
    ServiceLoader<LogFactory> loader = ServiceLoader.load(LogFactory.class);
    for (LogFactory lf : loader) {
      logFactory = lf;
      log("New instance, using: " + logFactory.getClass().getName());
      return;
    }
    try {
      final org.slf4j.ILoggerFactory lf = org.slf4j.LoggerFactory.getILoggerFactory();
      logFactory = new LogFactory() {
        @Override
        public Log getLog(String s) {
          return new Slf4jLogger(lf.getLogger(s));
        }
      };
      log("New instance, using SLF4J logging");
      return;
    } catch (NoClassDefFoundError ignore) {
    }
    try {
      final org.apache.commons.logging.LogFactory cl =
        org.apache.commons.logging.LogFactory.getFactory();
      logFactory = new LogFactory() {
        @Override
        public Log getLog(String s) {
          return new CommonsLogger(cl.getInstance(s));
        }
      };
      log("New instance, using commons logging");
      return;
    } catch (NoClassDefFoundError ignore) {
    }
    logFactory = new LogFactory() {
      @Override
      public Log getLog(String s) {
        return new JdkLogger(Logger.getLogger(s));
      }
    };
    log("New instance, using JDK logging");
  }
281115
protected void init() {
		// Get all our messages
		objectSingularName = getApplicationConfig().messageResolver().getMessage(
				modelId + ".objectName.singular");
		objectPluralName = getApplicationConfig().messageResolver().getMessage(
				modelId + ".objectName.plural");
	}
1130227
public static <T> void initialize(final Log log, final List<Filter<T>> filters) {

        // Check sanity
        Validate.notNull(log, "log");
        Validate.notNull(filters, "filters");

        for (Filter<T> current : filters) {
            current.initialize(log);
        }
    }
459050
def _init_log(level=logging.DEBUG):
    
    log = logging.getLogger(__file__)
    log.setLevel(level)
    handler = logging.StreamHandler(sys.stdout)
    handler.setLevel(level)
    formatter = logging.Formatter('%(asctime)s: %(message)s',
                                  '%Y/%m/%d-%H:%M:%S')
    handler.setFormatter(formatter)
    log.addHandler(handler)
    return log
603319
private void _initLogger(Map<String, ?> conf) {
        boolean logEnabled = (Boolean) RythmConfigurationKey.LOG_ENABLED.getConfiguration(conf);
        if (logEnabled) {
            ILoggerFactory factory = RythmConfigurationKey.LOG_FACTORY_IMPL.getConfiguration(conf);
            Logger.registerLoggerFactory(factory);
        } else {
            Logger.registerLoggerFactory(new NullLogger.Factory());
        }
    }
789672
public void init()
	{
		for (String packageName : traceManager.getTracePackages())
		{
			Logger logger = (Logger) LoggerFactory.getLogger(packageName);
			logger.addAppender(this);
		}
		start();
	}
222041
def init_logger(self):
        """"""
        # All logs are comming to this logger
        self.logger.setLevel(logging.DEBUG)
        self.logger.propagate = False

        # Logging to console
        if self.min_log_level_to_print:
            level = self.min_log_level_to_print
            handler_class = logging.StreamHandler
            self._create_handler(handler_class, level)

        # Logging to file
        if self.min_log_level_to_save:
            level = self.min_log_level_to_save
            handler_class = logging.handlers.TimedRotatingFileHandler
            self._create_handler(handler_class, level)

        # Logging to syslog
        if self.min_log_level_to_syslog:
            level = self.min_log_level_to_syslog
            handler_class = logging.handlers.SysLogHandler
            self._create_handler(handler_class, level)

        # Logging to email
        if self.min_log_level_to_mail:
            level = self.min_log_level_to_mail
            handler_class = AlkiviEmailHandler
            self._create_handler(handler_class, level)

        return
318088
public function initialize()
    {
        Notifire::reset();

        $manager = new NotificationManager();
        $manager->setThrowIfNotNotified(true);
        foreach ($this->handlers as $handler) {
            $manager->addHandler($handler);
        }

        if (null === $this->dispatcher) {
            $this->dispatcher = new EventDispatcher();
        }

        $manager->setEventDispatcher($this->dispatcher);
        foreach ($this->notifications as $notificationName => $notificationClass) {
            Notifire::addNotification($notificationName, $notificationClass);
        }

        Notifire::setManager($manager);
    }
793418
private static void initLogFile() {
    try (BufferedWriter bw = new BufferedWriter(new FileWriter(getLogPath()))) {
      Date date = new Date();
      bw.write("LT office integration log from " + date.toString() + logLineBreak);
    } catch (Throwable t) {
      showError(t);
    }
  }
1225029
def initialize_logging(args):
    """"""
    log_handler = logging.StreamHandler()
    log_formatter = logging.Formatter(
        "%(levelname)s %(asctime)s %(name)s:%(lineno)04d - %(message)s")
    log_handler.setFormatter(log_formatter)

    root_logger = logging.getLogger()
    root_logger.addHandler(log_handler)
    root_logger.setLevel(getattr(logging, args.loglevel))
780861
def _initialize():
  """"""
  global _absl_logger, _absl_handler

  if _absl_logger:
    return

  original_logger_class = logging.getLoggerClass()
  logging.setLoggerClass(ABSLLogger)
  _absl_logger = logging.getLogger('absl')
  logging.setLoggerClass(original_logger_class)

  python_logging_formatter = PythonFormatter()
  _absl_handler = ABSLHandler(python_logging_formatter)

  # The absl handler logs to stderr by default. To prevent double logging to
  # stderr, the following code tries its best to remove other handlers that emit
  # to stderr. Those handlers are most commonly added when logging.info/debug is
  # called before importing this module.
  handlers = [
      h for h in logging.root.handlers
      if isinstance(h, logging.StreamHandler) and h.stream == sys.stderr]
  for h in handlers:
    logging.root.removeHandler(h)

  # The absl handler will always be attached to root, not the absl logger.
  if not logging.root.handlers:
    # Attach the absl handler at import time when there are no other handlers.
    # Otherwise it means users have explicitly configured logging, and the absl
    # handler will only be attached later in app.run(). For App Engine apps,
    # the absl handler is not used.
    logging.root.addHandler(_absl_handler)
891894
def init_logger(log_requests=False):
    

    logger = logging.getLogger(__name__.split(".")[0])
    for handler in logger.handlers:  # pragma: nocover
        logger.removeHandler(handler)

    formatter = coloredlogs.ColoredFormatter(fmt="%(asctime)s: %(message)s")
    handler = logging.StreamHandler()
    handler.setLevel(logging.DEBUG)
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    logger.setLevel(logging.DEBUG)
    logger.propagate = False

    if log_requests:
        requests.packages.urllib3.add_stderr_logger()
302328
def _init_logging(verbose):
    """"""
    hdlr = logging.StreamHandler()
    hdlr.setFormatter(logging.Formatter(
        '%(asctime)s [%(levelname)s] [%(module)s] %(message)s'))
    LOG.addHandler(hdlr)
    if verbose:
        LOG.setLevel(logging.DEBUG)
        LOG.debug('Verbose output enabled.')
    else:
        LOG.setLevel(logging.INFO)