Control the logging state.
173433
def set_debug(self, status):
        """"""
        if status:
            self.logger.setLevel('DEBUG')
        else:
            self.logger.setLevel('INFO')
444147
def _configure_logger():
    """"""
    if not app.debug:
        _configure_logger_for_production(logging.getLogger())
    elif not app.testing:
        _configure_logger_for_debugging(logging.getLogger())
45551
public function logger() : void
  {
    LogHandler::$disk = DEPConfig::$appdir . 'storage' . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR;
    LogHandler::$name = config('app.logger.name');
    LogHandler::$log  = config('app.logger.log');
    LogHandler::$env  = config('app.env');

    LogHandler::event(function($env, $level, $message, $array) {
      Events::trigger('output.log', [$env, $level, $message, $array]);
    });
  }
402372
public void log() {
        for (int c=0; c<this.size(); c++) {
            this.setValue(c, s.log(this.getValue(c)));
        }
    }
985022
def setup_logging(cli_options):
    """"""
    if cli_options.debug_info or get_debug_level() > 0:
        levels = {2: logging.INFO, 3: logging.DEBUG}
        log_level = levels[get_debug_level()]
        log_format = '%(asctime)s [%(levelname)s] [%(name)s] -> %(message)s'

        if cli_options.debug_output == 'file':
            log_file = 'spyder-debug.log'
        else:
            log_file = None

        logging.basicConfig(level=log_level,
                            format=log_format,
                            filename=log_file,
                            filemode='w+')
229633
public synchronized void resetLogger() {
        Logger.appenderList.clear();
        Logger.stopWatch.stop();
        Logger.stopWatch.reset();
        Logger.firstLogEvent = true;
    }
1112272
public void ensureCompleted(Logging logger) {
    if(!isComplete()) {
      logger.warning("Progress had not completed automatically as expected: " + getProcessed() + "/" + total, new Throwable());
      setProcessed(getTotal());
      logger.progress(this);
    }
  }
38641
def set_output(self, state):
        """"""
        if state:
            self.instr.write('OUTP ON')
        else:
            self.instr.write('OUTP OFF')
584257
private void startLogScheduler() {
    this.logScheduler.scheduleAtFixedRate(
        new Runnable() {
          @Override
          public void run() {
            CLRBufferedLogHandler.this.logAll();
          }
        }, 0, LOG_SCHEDULE_PERIOD, TimeUnit.SECONDS);
  }
1026095
def stop(self):
        ''''''
        for key, value in self._configs.items():
            self._client.config_set(key, value)
        logs = self._client.execute_command('slowlog', 'get', 100000)
        current = {
            'name': None, 'accumulated': defaultdict(list)
        }
        for _, _, duration, request in logs:
            command = request[0]
            if command == 'slowlog':
                continue
            if 'eval' in command.lower():
                subcommand = request[3]
                self._timings['qless-%s' % subcommand].append(duration)
                if current['name']:
                    if current['name'] not in self._commands:
                        self._commands[current['name']] = defaultdict(list)
                    for key, values in current['accumulated'].items():
                        self._commands[current['name']][key].extend(values)
                current = {
                    'name': subcommand, 'accumulated': defaultdict(list)
                }
            else:
                self._timings[command].append(duration)
                if current['name']:
                    current['accumulated'][command].append(duration)
        # Include the last
        if current['name']:
            if current['name'] not in self._commands:
                self._commands[current['name']] = defaultdict(list)
            for key, values in current['accumulated'].items():
                self._commands[current['name']][key].extend(values)
970273
def set_log_level(logger, level):  # type: (logging.Logger, int) -> None
    """"""
    if level > 2:
        level = 2
    if level < -1:
        level = -1

    levels = {
        -1: logging.ERROR,
        0: logging.WARN,
        1: logging.INFO,
        2: logging.DEBUG
    }
    logger.setLevel(levels[level])
1087182
def set_up_logging(log_file, console_log_level):
    """"""
    logger = logging.getLogger()
    logger.setLevel(logging.DEBUG)
    fh = logging.FileHandler(str(log_file))
    fh.setLevel(logging.DEBUG)
    ch = logging.StreamHandler()
    ch.setLevel(console_log_level)
    formatter = logging.Formatter(
        "{asctime} {levelname} ({name}): {message}", style='{'
    )
    fh.setFormatter(formatter)
    ch.setFormatter(formatter)
    logger.addHandler(fh)
    logger.addHandler(ch)

    return logger
437113
def setup_logging():
    """"""
    config = json.load(open(os.path.join(config_path, 'logging.json')))

    # If syslogging is disabled, set the pipeline handler to NullHandler
    if dbconfig.get('enable_syslog_forwarding', NS_LOG, False):
        try:
            config['formatters']['syslog'] = {
                'format': _get_syslog_format('cloud-inquisitor-logs')
            }

            config['handlers']['syslog'] = {
                'class': 'cloud_inquisitor.log.SyslogPipelineHandler',
                'formatter': 'syslog',
                'filters': ['standard']
            }

            config['loggers']['cloud_inquisitor']['handlers'].append('syslog')

            # Configure the audit log handler
            audit_handler = SyslogPipelineHandler()
            audit_handler.setFormatter(logging.Formatter(_get_syslog_format('cloud-inquisitor-audit')))
            audit_handler.setLevel(logging.DEBUG)

            _AUDIT_LOGGER.addHandler(audit_handler)
            _AUDIT_LOGGER.propagate = False
        except Exception as ex:
            print('An error occured while configuring the syslogger: {}'.format(ex))

    logging.config.dictConfig(config)
1347351
def _set_logger(self):
        """"""
        self.logger.propagate = False
        hdl = logging.StreamHandler()
        fmt_str = '[querier][%(levelname)s] %(message)s'
        hdl.setFormatter(logging.Formatter(fmt_str))
        self.logger.addHandler(hdl)
84193
def init_logging(debug=False, logfile=None):
    """"""
    loglevel = logging.DEBUG if debug else logging.INFO
    logformat = '%(asctime)s %(name)s: %(levelname)s: %(message)s'
    formatter = logging.Formatter(logformat)
    stderr = logging.StreamHandler()
    stderr.setFormatter(formatter)

    root = logging.getLogger()
    root.setLevel(loglevel)
    root.handlers = [stderr]

    if logfile:
        fhandler = logging.FileHandler(logfile)
        fhandler.setFormatter(formatter)
        root.addHandler(fhandler)
279191
public synchronized static void enableLogging() {
        if (SplitlogLoggerFactory.state == SplitlogLoggingState.ON) {
            return;
        }
        SplitlogLoggerFactory.messageCounter.set(0);
        SplitlogLoggerFactory.state = SplitlogLoggingState.ON;
        /*
         * intentionally using the original logger so that this message can not
         * be silenced
         */
        LoggerFactory.getLogger(SplitlogLoggerFactory.class).info("Forcibly enabled Splitlog's internal logging.");
    }
124601
public static void setLogging(boolean logging) {
        if (logging) {
            logger.setLevel(debugging ? Level.FINE : Level.INFO);
        } else {
            logger.setLevel(Level.OFF);
        }
    }