call-seq:
    _setup( name, opts = {} )

 Configures internal variables for the logger. This method can be used
 to avoid storing the logger in the repository.
964374
def _setup( name, opts = {} )
      @name      = name
      @parent    = opts.fetch(:parent, nil)
      @appenders = opts.fetch(:appenders, [])
      @additive  = opts.fetch(:additive, true)
      @level     = opts.fetch(:level, nil)

      @caller_tracing = opts.fetch(:caller_tracing, false)

      ::Logging::Logger.define_log_methods(self)
    end
533902
def setup_logger(options):
    """"""
    LOGGER.setLevel(logging.INFO if options.verbose else logging.WARN)
    if options.report:
        LOGGER.removeHandler(STREAM)
        LOGGER.addHandler(logging.FileHandler(options.report, mode='w'))

    if options.options:
        LOGGER.info('Try to read configuration from: %r', options.options)
325361
def setup_logging(
    config='logging.yaml',
    default_level=logging.INFO,
    env_key='LOG_CFG'
):
    
    path = config
    value = os.getenv(env_key, None)
    if value:
        path = value

    if path.exists():
        with open(path, 'rt') as f:
            config = yaml.safe_load(f.read())
        logging.config.dictConfig(config)
    else:
        print('cannot read: ' + str(path))
        logging.basicConfig(level=default_level)
494344
def setup_logger(verbose, logfile):
    
    level = logging.WARNING
    if verbose == 1:
        level = logging.INFO
    elif verbose > 1:
        level = logging.DEBUG
    if logfile:
        logging.basicConfig(filename=logfile, level=level, format=LOGGING_FORMAT)
    else:
        logging.basicConfig(level=level, format=LOGGING_FORMAT)
353836
def setup_logging(config_path=None, log_level=logging.INFO,
                  formatter='standard'):
    

    config = {
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
            'standard': {
                'format':
                    '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
            },
            'ui': {
                'format':
                    '[%(levelname)s] %(message)s'
            }
        },
        'handlers': {
            'console': {
                'class': 'logging.StreamHandler',
                'level': log_level,
                'formatter': formatter,
                'stream': 'ext://sys.stdout'
            },
        },
        'loggers': {
            '': {
                'handlers': ['console'],
                'level': log_level,
                'propagate': True
            },
            'yapsy': {
                'handlers': ['console'],
                'level': logging.INFO
            }
        }
    }

    if config_path:
        if os.path.exists(config_path):
            with open(config_path, 'rt') as f:
                config = yaml.safe_load(f.read())
        else:
            print('Specified path does not exist: {}, '
                  'using default config'.format(config_path))

    logging.config.dictConfig(config)
100399
def setup(provider=None):
    
    site = init(provider)
    if not site:
        site = yaml.safe_load(_read_file(DEPLOY_YAML))

    provider_class = PROVIDERS[site['provider']]
    provider_class.init(site)
301905
def setup(args):
  """"""

  kwargs = {'wrapper_script' : args.wrapper_script, 'debug' : args.verbose==3, 'database' : args.database}
  if args.local:
    jm = local.JobManagerLocal(**kwargs)
  else:
    jm = sge.JobManagerSGE(**kwargs)

  # set-up logging
  if args.verbose not in range(0,4):
    raise ValueError("The verbosity level %d does not exist. Please reduce the number of '--verbose' parameters in your call to maximum 3" % level)

  # set up the verbosity level of the logging system
  log_level = {
      0: logging.ERROR,
      1: logging.WARNING,
      2: logging.INFO,
      3: logging.DEBUG
    }[args.verbose]

  handler = logging.StreamHandler()
  handler.setFormatter(logging.Formatter("%(asctime)s %(levelname)s %(name)s: %(message)s"))
  logger.addHandler(handler)
  logger.setLevel(log_level)

  return jm
894556
def setup_logging(home, verbose):
    """"""
    logging.setLoggerClass(MyLogger)
    logging.config.dictConfig({
        "version": 1,
        "disable_existing_loggers": False,
        "formatters": {
            "console": {
                "format": "%(levelname)-8s [%(asctime)s %(name)s] %(filename)s:%(lineno)s %(funcName)s: %(message)s",
            },
            "json": {
                "()": jsonlogger.JsonFormatter,
                "format": "%(levelname)s %(asctime)s %(name)s %(filename)s %(lineno)s %(funcName)s %(message)s",
            },
        },
        "handlers": {
            "default": {
                "level": "DEBUG" if verbose else "INFO",
                "class": "logging.StreamHandler",
                "formatter": "console",
            },
            "file": {
                "level": "DEBUG",
                "class": "logging.handlers.WatchedFileHandler",
                "filename": os.path.join(home, DEBUG_LOG_FILE),
                "formatter": "json",
            },
        },
        "loggers": {
            "": {
                "handlers": ["default", "file"],
                "level": "DEBUG",
                "propagate": True,
            },
        }
    })
685986
def setup_logger
      @logger = flexmock("logger")
      @logger.should_receive(:level).and_return(:info).by_default
      @logger.should_receive(:error).by_default.and_return { |m| raise m }
      @logger.should_receive(:warn).by_default.and_return { |m| raise m }
      @logger.should_receive(:info).by_default
      @logger.should_receive(:debug).by_default
      # Note that the following puts the mock logger inside the default Decorator
      # so the only way to mock the :exception interface is to flexmock the
      # logger if the constructed class that uses RightSupport::Log::Mixin
      RightSupport::Log::Mixin.default_logger = @logger
    end
1305681
def setup_logging(logging_config, debug=False):
    """"""

    if logging_config is not None:
        logging.config.fileConfig(logging_config)

    else:
        logging.basicConfig(level=debug and logging.DEBUG or logging.ERROR)
238910
def setup(self, app):
        '''
        
        '''
        self.logger = app.logger
        self.shell.logger = self.logger

        if not self.command_name:
            raise EmptyCommandNameException()

        self.app = app
        self.arguments_declaration = self.arguments
        self.arguments = app.arguments

        if self.use_subconfig:
            _init_config(self)
        else:
            self.config = self.app.config
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
906316
def setup(name, path='log', enable_debug=False):
    
    path_tmpl = os.path.join(path, '{name}_{level}.log')
    info = path_tmpl.format(name=name, level='info')
    warn = path_tmpl.format(name=name, level='warn')
    err = path_tmpl.format(name=name, level='err')
    crit = path_tmpl.format(name=name, level='crit')
    # a nested handler setup can be used to configure more complex setups
    setup = [
        # make sure we never bubble up to the stderr handler
        # if we run out of setup handling
        NullHandler(),
        # then write messages that are at least info to to a logfile
        TimedRotatingFileHandler(info, level='INFO', encoding='utf-8',
                                 date_format='%Y-%m-%d'),
        # then write messages that are at least warnings to to a logfile
        TimedRotatingFileHandler(warn, level='WARNING', encoding='utf-8',
                                 date_format='%Y-%m-%d'),
        # then write messages that are at least errors to to a logfile
        TimedRotatingFileHandler(err, level='ERROR', encoding='utf-8',
                                 date_format='%Y-%m-%d'),
        # then write messages that are at least critical errors to to a logfile
        TimedRotatingFileHandler(crit, level='CRITICAL', encoding='utf-8',
                                 date_format='%Y-%m-%d'),
    ]
    if enable_debug:
        debug = path_tmpl.format(name=name, level='debug')
        setup.insert(1, TimedRotatingFileHandler(debug, level='DEBUG',
                     encoding='utf-8', date_format='%Y-%m-%d'))
    if src_server is not None and smtp_server is not None \
            and smtp_port != 0 and len(dest_mails) != 0:
        mail_tmpl = '{name}_error@{src}'
        from_mail = mail_tmpl.format(name=name, src=src_server)
        subject = 'Error in {}'.format(name)
        # errors should then be delivered by mail and also be kept
        # in the application log, so we let them bubble up.
        setup.append(MailHandler(from_mail, dest_mails, subject,
                                 level='ERROR', bubble=True,
                                 server_addr=(smtp_server, smtp_port)))

    return NestedSetup(setup)
1084002
function(opt) {
        if ( typeof(Logger.initialized) != "undefined" ) {
            console.debug("Logger instance already exists. Loading it.");
            return getInstance(opt)
        } else {
            Logger.initialized = true;
            Logger.instance = self;
            setDefaultLevels();
        }
    }
1304982
def setup_logging():
    
    fmt = 'DBG<0>%(pathname)s:%(lineno)d  %(funcName)s: %(message)s'

    handler_stderr = logging.StreamHandler(sys.stderr)
    handler_stderr.setFormatter(logging.Formatter(fmt))

    root_logger = logging.getLogger()
    root_logger.setLevel(logging.DEBUG)
    root_logger.addHandler(handler_stderr)
1042444
@Override
    public void setup() {

        // Redirect the JUL Logging statements to the Maven Log.
        rootLogger.setLevel(MavenLogHandler.getJavaUtilLoggingLevelFor(log));
        this.mavenLogHandler = new MavenLogHandler(log, logPrefix, encoding, loggerNamePrefixes);

        for (Handler current : rootLogger.getHandlers()) {

            // Stash the original handlers from the RootLogger.
            originalHandlers.add(current);

            // Remove the original handler from the RootLogger.
            rootLogger.removeHandler(current);
        }

        // Add the new Maven Log handler.
        rootLogger.addHandler(this.mavenLogHandler);
    }
460360
def configure(self, options, conf):
        
        super(S3Logging, self).configure(options, conf)
        self.options = options