Recursively parses the loaded settings and creating log file destinations
 @param [Hash] the loaded settings
 @param [LogFile] the logfile object
 @see Logmsg:LogFile
 @private
774846
def parse(settings, logfile = nil)
      settings.each do |key, value|
        if value.is_a?(Hash)
          logfile = Logmsg::LogFile.new(key)
          logfiles[key.to_sym] = logfile
          parse(value, logfile)
          logfile.register
        else
          logfile.public_send("#{key}=", value)
        end
      end
    end
1108359
def load
      log.debug "Loading routes from: #{self.route_file}"
      self.routes = []
      
      file = File.open(self.route_file)
      @app.instance_eval(file.read)
    end
291128
function SetSettings(settings) {
		try { CFG = TLS.Fill(settings, CFG); Dbg = CFG.Debug } 
		catch (error) { LG.IF(error); }
	}
1105902
def clear_logs
      ::RSpec.configure do |config|
        config.add_setting :clear_log_file
        config.clear_log_file = Rails.root.join('log', 'test.log') if defined?(Rails.root)
        config.add_setting :clear_log_file_proc
        config.clear_log_file_proc = ->(file) do
          next unless file && File.exist?(file)
          FileUtils.cp(file, "#{file}.last")
          File.open(file, 'w').close
        end
        config.after(:suite) do
          instance_exec(config.clear_log_file, &config.clear_log_file_proc) unless ENV['KEEP_LOG']
        end
      end
    end
498686
def load!(path)
      settings = YAML.safe_load(ERB.new(File.new(path).read).result)['api']
      from_hash(settings) if settings.is_a? Hash
    end
126655
function () {
      var args = [], len = arguments.length;
      while ( len-- ) args[ len ] = arguments[ len ];

      if (!settings$2.debug) {
        return;
      }
      args.unshift('DEBUG');
      settings$2.logger.output.apply(null, args);
    }
1086849
def pre_config( config )
      # if no pre_config section was given, just create an empty hash
      # we do this to ensure that some logging levels are always defined
      config ||= Hash.new

      # define levels
      levels = config['define_levels']
      ::Logsly::Logging182.init(levels) unless levels.nil?

      # format as
      format = config['format_as']
      ::Logsly::Logging182.format_as(format) unless format.nil?

      # backtrace
      value = config['backtrace']
      ::Logsly::Logging182.backtrace(value) unless value.nil?

      # grab the root logger and set the logging level
      root = ::Logsly::Logging182::Logger.root
      if config.has_key?('root')
        root.level = config['root']['level']
      end
    end
271907
def load_config(file = @options.config)
      config = load(file)
      config[:timezone_difference] = 0        if config[:timezone_difference].nil?
      config[:mentions]            = {}       if config[:mentions].nil?
      config[:mentions][:enabled]  = true     if config[:mentions][:enabled].nil?
      config[:mentions][:top]      = 10       if config[:mentions][:top].nil?
      config[:mentions][:notop]    = 20       if config[:mentions][:notop].nil?
      config[:clients]             = {}       if config[:clients].nil?
      config[:clients][:enabled]   = true     if config[:clients][:enabled].nil?
      config[:clients][:top]       = 10       if config[:clients][:top].nil?
      config[:clients][:notop]     = 20       if config[:clients][:notop].nil?
      config[:hashtags]            = {}       if config[:hashtags].nil?
      config[:hashtags][:enabled]  = true     if config[:hashtags][:enabled].nil?
      config[:hashtags][:top]      = 10       if config[:hashtags][:top].nil?
      config[:hashtags][:notop]    = 20       if config[:hashtags][:notop].nil?
      config[:smileys]             = {}       if config[:smileys].nil?
      config[:smileys][:enabled]   = true     if config[:smileys][:enabled].nil?
      config[:smileys][:top]       = 10       if config[:smileys][:top].nil?
      config[:smileys][:notop]     = 0        if config[:smileys][:notop].nil?
      config[:ignored_users]       = []       if config[:ignored_users].nil?
      config[:renamed_users]       = []       if config[:renamed_users].nil?
      args_override config
    end
671535
def load_config(logdir):
  # pylint: disable=missing-raises-doc
  
  config_path = logdir and os.path.join(logdir, 'config.yaml')
  if not config_path or not tf.gfile.Exists(config_path):
    message = (
        'Cannot resume an existing run since the logging directory does not '
        'contain a configuration file.')
    raise IOError(message)
  with tf.gfile.FastGFile(config_path, 'r') as file_:
    config = yaml.load(file_, Loader=yaml.Loader)
  message = 'Resume run and write summaries and checkpoints to {}.'
  tf.logging.info(message.format(config.logdir))
  return config
1065942
def restoreSettings(self, settings):
        
        levels = unwrapVariant(settings.value('levels'))
        if levels:
            self.setActiveLevels(map(int, levels.split(',')))
        
        logger_levels = unwrapVariant(settings.value('loggerLevels'))
        if logger_levels:
            for key in logger_levels.split(','):
                logger, lvl = key.split(':')
                lvl = int(lvl)
                self.setLoggerLevel(logger, lvl)
        
        filt = unwrapVariant(settings.value('filter'))
        if filt:
            self.uiFilterTXT.setText(filt)
        self.uiRecordTREE.restoreSettings(settings)
391008
function(opts) {
	if (!opts) { opts = {}; }

	this._opts = opts;
	this._logRequestQueue = [];
	this._backends = new Map();

	// Set up regular expressions so that logTypes can be registered with
	// backends, and so that logData can be routed to the right backends.
	// Default: matches empty string only
	this._testAllRE = new RegExp(/^$/);

	this._samplers = [];
	this._samplersRE = new RegExp(/^$/);
	this._samplersCache = new Map();
}
697265
def load_settings(path)

        # Load the data files
        Konfig.load_directory(path)

        # Load all adapters
        built_in_adapters = File.join(File.dirname(__FILE__), 'adapters', '*.rb')
        require_all built_in_adapters

        user_adapters = File.join(path, 'adapters', '*_adapter.rb')
        require_all user_adapters

        # Apply the adapters to the data
        Adapter.create_child_instances(Konfig.default_store.data)
        Adapter.send_to_child_instances :adapt
      end
396159
def default_load_paths
      paths = []

      # Check for Rails config path
      paths << "#{::Rails.root}/config" if rails?

      # Check for defined constants
      paths << CONFIG_ROOT if defined?(CONFIG_ROOT) && Dir.exists?(CONFIG_ROOT)
      paths << CONFIG_PATH if defined?(CONFIG_PATH) && Dir.exists?(CONFIG_PATH)

      # Check for config directory in app root
      config_dir = File.join(app_root, 'config')
      paths << config_dir if Dir.exists?(config_dir)

      paths
    end
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))
1072423
def _parse_options(entry, options, include_unset=True):
    '''
    
    '''
    log_cfg = {}
    options = shlex.split(options)
    if not options:
        return None

    ## identifier is entry or log?
    if entry.startswith('/'):
        log_cfg['log_file'] = entry
    else:
        log_cfg['entryname'] = entry

    ## parse options
    # NOTE: we loop over the options because values may exist multiple times
    index = 0
    while index < len(options):
        # log file
        if index in [0, (len(options)-1)] and options[index].startswith('/'):
            log_cfg['log_file'] = options[index]

        # check if toggle option
        elif options[index] in option_toggles:
            log_cfg[option_toggles[options[index]]] = True

        # check if flag option
        elif options[index] in option_flags and (index+1) <= len(options):
            log_cfg[option_flags[options[index]]] = int(options[index+1]) if options[index+1].isdigit() else options[index+1]
            index += 1

        # unknown options
        else:
            if 'additional_options' not in log_cfg:
                log_cfg['additional_options'] = []
            if ' ' in options[index]:
                log_cfg['dditional_options'] = "'{}'".format(options[index])
            else:
                log_cfg['additional_options'].append(options[index])

        index += 1

    ## turn additional_options into string
    if 'additional_options' in log_cfg:
        log_cfg['additional_options'] = " ".join(log_cfg['additional_options'])

    ## ensure we have a log_file
    # NOTE: logadm assumes logname is a file if no log_file is given
    if 'log_file' not in log_cfg and 'entryname' in log_cfg:
        log_cfg['log_file'] = log_cfg['entryname']
        del log_cfg['entryname']

    ## include unset
    if include_unset:
        # toggle optioons
        for name in option_toggles.values():
            if name not in log_cfg:
                log_cfg[name] = False

        # flag options
        for name in option_flags.values():
            if name not in log_cfg:
                log_cfg[name] = None

    return log_cfg
462995
def parse_yaml(file)
      file_content = File.exist?(file) ? ERB.new(File.read(file)).result : '---'

      config = YAML.load(file_content) || {}
      env    = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || ENV['APP_CONFIG_ENV']

      config_from config['default'], config[env]
    end
1352171
def parse_config_file
      unless file? config_file
        logger.debug "Configuration file not found: #{config_file}"
        return {}
      end

      logger.debug "Reading configuration file: #{config_file}."
      symbolise YAML.load_file(config_file)
    rescue StandardError => error
      raise CONFIG_FILE_ERROR.new(config_file, error)
    end