Initializes the logger object from the standard library. This method
 should only be called inside the register method
 @private
9681
def init_logger
      @logger = case @path
                when STDOUT_STREAM then Logger.new(STDOUT)
                when STDERR_STREAM then Logger.new(STDERR)
                else Logger.new(File.open(@path, 'a'))
                end
      @logger.datetime_format = @datetime_format
      @logger.sev_threshold = @threshold unless @severities.any?
      @logger.formatter = @formatter unless @formatter.nil?
    end
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
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))
242073
function initLogging(conf) {
    logger.setLevels({
        error: 0,
        warn: 1,
        info: 2,
        verbose: 3,
        debug: 4,
        silly: 5
    });
    logger.addColors({
        debug: 'green',
        info: 'cyan',
        silly: 'magenta',
        warn: 'yellow',
        error: 'red'
    });

    logger.remove(logger.transports.Console);
    logger.add(logger.transports.Console, {
        level: conf.level || DEF_LOGGER_LEVEL,
        silent: conf.silent || DEF_LOGGER_SILENT,
        colorize: true,
        timestamp: true
    });
}
1195672
@SuppressWarnings( { "NestedTryStatement" })
    public void init_logger() {
	try {
	    Util.out4.println("Initializing logging for " + get_name());
	    // - Get Util instance
	    final Util util = Util.instance();
	    // - Get cmd line logging level then ...
	    final int trace_level = util.get_trace_level();
	    // ... convert it to log4j level
	    Level cmd_line_level;
	    // does the logging level set from cmd line?
	    boolean level_set_from_cmd_line = true;
	    if (trace_level <= 0) {
		level_set_from_cmd_line = false;
		cmd_line_level = Level.OFF;
	    } else if (trace_level <= 2) {
		cmd_line_level = Level.INFO;
	    } else {
		cmd_line_level = Level.DEBUG;
	    }
	    // - Add a console target if logging level set from cmd line
	    if (level_set_from_cmd_line) {
		// add a console target if logging level set from cmd line
		try {
		    Logging.instance().add_logging_target(get_logger(), LOGGING_CONSOLE_TARGET);
		} catch (final DevFailed df) {
		    /** ignore exception */
		}
	    }
	    if (!Util._UseDb) {
		// - Done if we are not using the database
		Util.out4.println("Not using the database. Logging Intialization complete");
		return;
	    }
	    // - Get both logging level and targets from database
	    final Logging.LoggingProperties properties = Logging.instance().get_logging_properties(
		    get_logger(), util.get_database());
	    if (properties == null) {
		Util.out4.println("Failed to obtain logging properties from database");
		Util.out4.println("Aborting logging intialization");
		get_logger().setLevel(cmd_line_level);
		return;
	    }
	    // - Set logging level
	    if (level_set_from_cmd_line == false) {
		get_logger().setLevel(properties.logging_level);
		Util.out4.println("Logging level set to " + properties.logging_level.toString());
	    } else {
		get_logger().setLevel(cmd_line_level);
	    }
	    // - Save current logging level
	    last_level = get_logger().getLevel();
	    // - Get rolling threshold for file targets
	    if (rft != properties.logging_rft) {
		rft = properties.logging_rft;
		Util.out4.println("Rolling threshold changed to " + String.valueOf(rft));
	    }
	    // - Set logging targets
	    if (properties.logging_targets != null) {
		Util.out4.println("Adding logging targets (" + properties.logging_targets.length
			+ " entries in db)");
		for (final String logging_target : properties.logging_targets) {
		    try {
			Logging.instance().add_logging_target(get_logger(), logging_target);
		    } catch (final DevFailed e) { /* ignore any exception */
		    }
		}
	    }
	    // set rolling file threshold for file targets
	    Logging.instance().set_rolling_file_threshold(get_logger(), rft);
	} catch (final Exception e) {
	    // igore any exception
	}
    }
250803
def logger=(logger)
      case logger
      when false, nil then @logger = NullLogger.new
      when true then @logger = default_logger
      else
        @logger = logger if logger.respond_to?(:info)
      end
    end
658528
def init_logger(v_num: int):
    
    logging.addLevelName(LogLevel.INFO_LV1.value, 'INFO_LV1')  # type: ignore # Prevent for enum problem
    logging.addLevelName(LogLevel.INFO_LV2.value, 'INFO_LV2')  # type: ignore # Prevent for enum problem
    logging.addLevelName(LogLevel.INFO_LV3.value, 'INFO_LV3')  # type: ignore # Prevent for enum problem

    logging.config.dictConfig(create_logger_config({  # type: ignore # Prevent for enum problem
        0: LogLevel.INFO_LV1,
        1: LogLevel.INFO_LV2,
        2: LogLevel.INFO_LV3,
        3: LogLevel.DEBUG,
    }[v_num]))
257605
def init(track_log_handler):
    

    logger = logging.getLogger(__package__)

    # TODO (just document prominently)
    # assume only one trial can run at once right now
    # multi-concurrent-trial support will require complex filter logic
    # based on the currently-running trial (maybe we shouldn't allow multiple
    # trials on different python threads, that's dumb)
    to_rm = [h for h in logger.handlers if isinstance(h, TrackLogHandler)]
    for h in to_rm:
        logger.removeHandler(h)

    if not any(isinstance(h, StdoutHandler) for h in logger.handlers):
        handler = StdoutHandler()
        handler.setFormatter(_FORMATTER)
        logger.addHandler(handler)

    track_log_handler.setFormatter(_FORMATTER)
    logger.addHandler(track_log_handler)

    logger.propagate = False
    logger.setLevel(logging.DEBUG)
583622
def initialize_logging(self):
        """"""
        # Reset logging to pass logrecords into the queue to the frontend only.
        # Existing handlers may be broken as they were copied into a new process,
        # so should be discarded.
        for loggername in [None] + list(logging.Logger.manager.loggerDict.keys()):
            logger = logging.getLogger(loggername)
            while logger.handlers:
                logger.removeHandler(logger.handlers[0])

        # Re-enable logging to console
        root_logger = logging.getLogger()

        # By default pass all warning (and higher) level messages to the frontend
        root_logger.setLevel(logging.WARN)
        root_logger.addHandler(workflows.logging.CallbackHandler(self._log_send))

        # Set up the service logger and pass all info (and higher) level messages
        # (or other level if set differently)
        self.log = logging.getLogger(self._logger_name)

        if self.start_kwargs.get("verbose_log"):
            self.log_verbosity = logging.DEBUG
        self.log.setLevel(self.log_verbosity)

        # Additionally, write all critical messages directly to console
        console = logging.StreamHandler()
        console.setLevel(logging.CRITICAL)
        root_logger.addHandler(console)
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");
  }
1369490
def initialize(self):
        """"""

        self.logger = logging.getLogger(self.__class__.__name__)
        self.client = None
1078312
function LoggerContext(logger, module) {
  if (!(this instanceof LoggerContext))
    return new LoggerContext(logger, module);

  assert(typeof module === 'string');

  this.logger = logger;
  this.module = module;
}
769792
function Logger_createReadLogServer() {
            var that = this;
            this.server = new HttpServer();
            this.server.on('request', function (request, response) {
                var startMessage = 'LAST '+ that.config.readLength + ' BYTES:\n\n';

                fs.open(that.file, 'r', 755, function(status, fd) {
                    fs.fstat(fd, function (err, stats) {
                        var size = stats.size,
                            start = size > that.config.readLength ? size - that.config.readLength : 0,
                            end = size > that.config.readLength ? that.config.readLength : size,
                            buffer =  new Buffer(end + startMessage.length);
                        buffer.fill(startMessage);
                        fs.read(fd, buffer, startMessage.length, end, start, function() {
                            response.writeHead(200, {'Content-type': 'text/plain', 'Content-Length': buffer.length});
                            response.end(buffer);
                        });
                    });
                });

            });

            this.server.listen(this.config.port);

            this.info('Publishing log write stream on port: ', this.config.port);
        }
10304
protected static void initLogger ()
    {
        // if a custom class was specified as a system property, use that
        Factory factory = createConfiguredFactory();

        // create and a log4j logger if the log4j configuration system property is set
        try {
            if (factory == null && System.getProperty("log4j.configuration") != null) {
                factory = (Factory)Class.forName("com.samskivert.util.Log4JLogger").newInstance();
            }
        } catch (SecurityException se) {
            // in a sandbox, no biggie
        } catch (Throwable t) {
            System.err.println("Unable to instantiate Log4JLogger: " + t);
        }

        // create and a log4j2 logger if the log4j2 configuration system property is set
        try {
            if (factory == null && System.getProperty("log4j.configurationFile") != null) {
                factory = (Factory)Class.forName("com.samskivert.util.Log4J2Logger").newInstance();
            }
        } catch (SecurityException se) {
            // in a sandbox, no biggie
        } catch (Throwable t) {
            System.err.println("Unable to instantiate Log4J2Logger: " + t);
        }

        // lastly, fall back to the Java logging system
        if (factory == null) {
            factory = new JDK14Logger();
        }

        // and finally configure our factory
        setFactory(factory);
    }
411600
def init_logging():
    
    # Forward to Go backend
    logging.addLevelName(TRACE_LEVEL, 'TRACE')
    logging.setLoggerClass(AgentLogger)
    rootLogger = logging.getLogger()
    rootLogger.addHandler(AgentLogHandler())
    rootLogger.setLevel(_get_py_loglevel(datadog_agent.get_config('log_level')))

    # `requests` (used in a lot of checks) imports `urllib3`, which logs a bunch of stuff at the info level
    # Therefore, pre emptively increase the default level of that logger to `WARN`
    urllib_logger = logging.getLogger("requests.packages.urllib3")
    urllib_logger.setLevel(logging.WARN)
    urllib_logger.propagate = True
1079162
private function initializeLogger()
    {
        if (Log::hasLogger()) {
            return;
        }

        $logger = new Logger('ZCrawler');

        if (!Config::get('debug') || defined('PHPUNIT_RUNNING')) {
            $logger->pushHandler(new NullHandler());
        } elseif (Config::get('log.handler') instanceof HandlerInterface) {
            $logger->pushHandler(Config::get('log.handler'));
        } elseif ($logFile = Config::get('log.file')) {
            $logger->pushHandler(new StreamHandler($logFile, Config::get('log.level', Logger::WARNING)));
        }

        Log::setLogger($logger);
    }
435705
def initLogger(name):  # pylint: disable=invalid-name
    '''
    
    '''
    logger = logging.getLogger(name)
    logger.setLevel(logging.INFO)
    # Skip attaching StreamHandler if one is already attached to logger
    if not getattr(logger, "streamhandler_set", None):
        consolehandler = logging.StreamHandler()
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
        consolehandler.setFormatter(formatter)
        consolehandler.setLevel(logging.INFO)
        logger.addHandler(consolehandler)
        logger.streamhandler_set = True
    return logger