log config file usages
969370
function logConfigFile(configFile, logger) {
  let message;
  if (process.env.WORKER_ID !== undefined) {
    message = `Worker ${process.env.WORKER_ID} uses configuration file: ${configFile}`;
  } else {
    message = `Supervisor uses configuration file: ${configFile}`;
  }
  if (logger && logger.verbose) {
    logger.verbose(message);
  } else {
    // eslint-disable-next-line no-console
    console.log(message);
  }
}
289438
def log_configs(self):
        """"""
        for sec in self.config.sections():
            LOG.debug('   %s: %s', sec, self.config.options(sec))
864395
def _adjust_log_file_override(overrides, default_log_file):
    '''
    
    '''
    if overrides.get('log_dir'):
        # Adjust log_file if a log_dir override is introduced
        if overrides.get('log_file'):
            if not os.path.isabs(overrides['log_file']):
                # Prepend log_dir if log_file is relative
                overrides['log_file'] = os.path.join(overrides['log_dir'],
                                                     overrides['log_file'])
        else:
            # Create the log_file override
            overrides['log_file'] = \
                os.path.join(overrides['log_dir'],
                             os.path.basename(default_log_file))
870464
def log(self) :
		""""""
		
		self.logs['epochDuration'].append(self.lastEpochDuration)
		self.logs['avg'].append(self.avg)
		self.logs['runtime'].append(self.runtime)
		self.logs['remtime'].append(self.remtime)
1065672
public static void logMesosConfig(Logger log, MesosConfiguration config) {

		Map<String, String> env = System.getenv();
		Protos.FrameworkInfo.Builder info = config.frameworkInfo();

		log.info("--------------------------------------------------------------------------------");
		log.info(" Mesos Info:");
		log.info("    Master URL: {}", config.masterUrl());

		log.info(" Framework Info:");
		log.info("    ID: {}", info.hasId() ? info.getId().getValue() : "(none)");
		log.info("    Name: {}", info.hasName() ? info.getName() : "(none)");
		log.info("    Failover Timeout (secs): {}", info.getFailoverTimeout());
		log.info("    Role: {}", info.hasRole() ? info.getRole() : "(none)");
		log.info("    Capabilities: {}",
			info.getCapabilitiesList().size() > 0 ? info.getCapabilitiesList() : "(none)");
		log.info("    Principal: {}", info.hasPrincipal() ? info.getPrincipal() : "(none)");
		log.info("    Host: {}", info.hasHostname() ? info.getHostname() : "(none)");
		if (env.containsKey("LIBPROCESS_IP")) {
			log.info("    LIBPROCESS_IP: {}", env.get("LIBPROCESS_IP"));
		}
		if (env.containsKey("LIBPROCESS_PORT")) {
			log.info("    LIBPROCESS_PORT: {}", env.get("LIBPROCESS_PORT"));
		}
		log.info("    Web UI: {}", info.hasWebuiUrl() ? info.getWebuiUrl() : "(none)");

		log.info("--------------------------------------------------------------------------------");

	}
1227899
def log_config(self, logger):
        """'"""

        logger.info("app_name: %s", self.app_name)
        logger.info("app_version: %s", self.app_version)
        logger.info("current configuration:")
        config = [(key, self.option_definitions[key].value)
                  for key in self.option_definitions.keys_breadth_first()
                  if key not in self.keys_blocked_from_output]
        config.sort()
        for key, val in config:
            if (
                self.option_definitions[key].secret
                or 'password' in key.lower()
            ):
                logger.info('%s: *********', key)
            else:
                try:
                    logger.info('%s: %s', key,
                                to_string_converters[type(key)](val))
                except KeyError:
                    logger.info('%s: %s', key, val)
1172724
def configured_logger(name=None, config=None, level=None, handlers=None):
    '''
    '''
    name = name or ''
    with process_global('lock'):
        logconfig = process_global('_config_logging')
        # if the logger was not configured, do so.
        if not logconfig:
            logconfig = deepcopy(config or LOGGING_CONFIG)
            logconfig['configured'] = set()
            process_global('_config_logging', logconfig, True)
        else:
            configured = logconfig.get('configured')
            if name in configured:
                return logging.getLogger(name)

        level = get_level(level)
        # No loggers configured. This means no logconfig setting
        # parameter was used. Set up the root logger with default
        # loggers
        if level == logging.NOTSET:
            handlers = ['silent']

        level = logging.getLevelName(level)
        cfg = {'level': level, 'propagate': False}
        if handlers:
            cfg['handlers'] = handlers

        config = copy(logconfig)
        configured = config.pop('configured')
        configured.add(name)

        if name:
            config.pop('root', None)
            loggers = config.pop('logger', {})
            if name in loggers:
                loggers[name].update(cfg)
                cfg = loggers[name]
            config['loggers'] = {name: cfg}
        else:
            if 'root' in config:
                config['root'].update(cfg)
                cfg = config['root']
            if 'handlers' not in cfg:
                cfg['handlers'] = ['console']
            config['root'] = cfg
        #
        dictConfig(config)
        return logging.getLogger(name)
492480
def logging_config(logpath=None,
                   level=logging.DEBUG,
                   console_level=logging.INFO,
                   no_console=False):
    
    logger = logging.getLogger('nli')
    # Remove all the current handlers
    for handler in logger.handlers:
        logger.removeHandler(handler)
    logger.handlers = []
    logger.propagate = False
    logger.setLevel(logging.DEBUG)

    formatter = logging.Formatter('%(filename)s:%(funcName)s: %(message)s')

    if logpath is not None:
        print('All Logs will be saved to {}'.format(logpath))
        logfile = logging.FileHandler(logpath, mode='w')
        logfile.setLevel(level)
        logfile.setFormatter(formatter)
        logger.addHandler(logfile)

    if not no_console:
        # Initialze the console logging
        logconsole = logging.StreamHandler()
        logconsole.setLevel(console_level)
        logconsole.setFormatter(formatter)
        logger.addHandler(logconsole)
445784
public synchronized void logConfigReport() {
    ConfigStatus reportStatus = mConfigCheckReport.getConfigStatus();
    if (reportStatus.equals(ConfigStatus.PASSED)) {
      LOG.info(CONSISTENT_CONFIGURATION_INFO);
    } else if (reportStatus.equals(ConfigStatus.WARN)) {
      LOG.warn("{}\nWarnings: {}", INCONSISTENT_CONFIGURATION_INFO,
          mConfigCheckReport.getConfigWarns().values().stream()
              .map(Object::toString).limit(LOG_CONF_SIZE).collect(Collectors.joining(", ")));
    } else {
      LOG.error("{}\nErrors: {}\nWarnings: {}", INCONSISTENT_CONFIGURATION_INFO,
          mConfigCheckReport.getConfigErrors().values().stream()
              .map(Object::toString).limit(LOG_CONF_SIZE).collect(Collectors.joining(", ")),
          mConfigCheckReport.getConfigWarns().values().stream()
              .map(Object::toString).limit(LOG_CONF_SIZE).collect(Collectors.joining(", ")));
    }
  }
964584
def use_config_file(self):
        """"""
        self.config_file = self.find_config_file()
        if self.config_file:
            self.apply_config_file(self.config_file)
499386
def get_default_config_help(self):
        
        config = super(ArchiveHandler, self).get_default_config_help()

        config.update({
            'log_file': 'Path to the logfile',
            'when': 'type of interval; S, M, H, D, Weekday, midnight',
            'days': 'How many days to store',
            'rollover_interval': 'rollover interval length',
            'encoding': '',
            'propagate': 'Pass handled metrics to configured root logger',
        })

        return config
645863
def config_logging(args):
    '''  '''
    if args.quiet:
        logging.getLogger().setLevel(logging.CRITICAL)
    elif args.verbose:
        logging.getLogger().setLevel(logging.DEBUG)
296600
def show_config(config):
    """"""
    print("\nCurrent Configuration:\n")
    for k, v in sorted(config.config.items()):
        print("{0:15}: {1}".format(k, v))
23181
private void parseLoggingConfig(final Node node, final ConfigSettings config)
	{

		String name;
		String value;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_ROOT_FOLDER)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				value = value.substring(1, value.length() - 1);

				config.setConfigParameter(
						ConfigurationKeys.LOGGING_PATH_DIFFTOOL, value);

			}
			else if (name.equals(SUBSUBSECTION_DIFF_TOOL)) {

				parseLoggerConfig(nnode, config, null,
						ConfigurationKeys.LOGGING_LOGLEVEL_DIFFTOOL);

			}
		}
	}
1197287
def get_log_dir(self, conf_file):
        
        log_dir = None

        with open(conf_file, 'r') as conf_f:
            for line in conf_f:
                line = line.split('#')[0].strip()

                try:
                    (key, value) = line.split('=', 1)
                    if key.strip() == 'log-dir':
                        log_dir = value.strip()
                except ValueError:
                    pass

        return log_dir
1371910
function SlowLog(conf) {
  this._conf = conf;

  // log commands slower than this number of microseconds
  // disabled by default
  this._slowerThan = -1;

  // maximum length of the slow log
  this._maxLen = 128;

  // set up log records array
  this.reset();

  // log record for the current executing command
  this._record = null;

  function onConfigLoad() {
    this._slowerThan = conf.get(ConfigKey.SLOWLOG_LOG_SLOWER_THAN);
    this._maxLen = conf.get(ConfigKey.SLOWLOG_MAX_LEN);
  }

  function onSlowerThan(key, value) {
    this._slowerThan = value;
  }

  function onMaxLen(key, value) {
    // minimum record length is one, if a user wishes
    // to disable slow logs they should set slowlog-log-slower-than to -1
    this._maxLen = Math.max(value, 1);
  }

  onConfigLoad = onConfigLoad.bind(this);
  onSlowerThan = onSlowerThan.bind(this);
  onMaxLen = onMaxLen.bind(this);

  this._conf.once('load', onConfigLoad.bind(this));

  this._conf.on(ConfigKey.SLOWLOG_LOG_SLOWER_THAN, onSlowerThan);
  this._conf.on(ConfigKey.SLOWLOG_MAX_LEN, onMaxLen);

  // bind stop here as it is called as a before
  // function on the response
  this.stop = this.stop.bind(this);
}
975220
def dump_config(self):  # pragma: no cover
        """"""
        with open(self.config_path, 'r') as cfg_fh:
            base_config = cfg_fh.read()

        print(base_config)
        exit(2)