create logger object, enable or disable logging
505380
def set(self, mode, disable):
        
        global logger
        try:
            if logger:
                if disable:
                    logger.disabled = True
            else:
                if mode in ('STREAM', 'FILE'):
                    logger = logd.getLogger(mode, __version__)
        except Exception as e:
            logger.exception(
                '%s: Problem incurred during logging setup' % inspect.stack()[0][3]
                )
            return False
        return True
361250
def build_default_logger(
    logger_name='logger',
    log_level=None,
    log_dir=None,
    console_enabled=True,
    max_log_size=5*1024*1024,
    max_backup_logs=5):
    '''
    
    '''
    old_logger_class = logging.getLoggerClass()
    logging.setLoggerClass(DefaultLogger)
    logger = logging.getLogger(logger_name)
    logging.setLoggerClass(old_logger_class)

    if log_level:
        logger.setLevel(log_level)
    logger.apply_default_handlers(log_dir, console_enabled, max_log_size, max_backup_logs)
    return logger
38894
function setupLogger() {
  "use strict";
  var options = require('./config');

  if (options.v.length == 3) {
    Logger.level = Logger.levels.verbose;
  } else if (options.v.length == 2) {
    Logger.level = Logger.levels.debug;
  } else if (options.v.length == 1) {
    Logger.level = Logger.levels.info;
  } else if (options.s) {
    Logger.level = Logger.levels.noLog;
  }
}
444147
def _configure_logger():
    """"""
    if not app.debug:
        _configure_logger_for_production(logging.getLogger())
    elif not app.testing:
        _configure_logger_for_debugging(logging.getLogger())
473869
def configure_logging():
    

    if not parse_boolean(os.environ.get('DISABLE_TRUSTAR_LOGGING')):

        # configure
        dictConfig(DEFAULT_LOGGING_CONFIG)

        # construct error logger
        error_logger = logging.getLogger("error")

        # log all uncaught exceptions
        def log_exception(exc_type, exc_value, exc_traceback):
            error_logger.error("Uncaught exception", exc_info=(exc_type, exc_value, exc_traceback))

        # register logging function as exception hook
        sys.excepthook = log_exception
1046859
def create_logger(app: 'Quart') -> Logger:
    
    logger = getLogger('quart.app')

    if app.debug and logger.level == NOTSET:
        logger.setLevel(DEBUG)

    logger.addHandler(default_handler)
    return logger
866202
def set_logging(cfg_obj):
    
    log_status = cfg_obj['LOGGING']['ENABLE_LOGGING']

    if log_status:
        logger.disabled = False
    elif not log_status:
        logger.info(
            '%s: Logging disabled per local configuration file (%s) parameters.' %
            (inspect.stack()[0][3], cfg_obj['PROJECT']['CONFIG_PATH'])
            )
        logger.disabled = True
    return log_status
1204087
def setup_logging(verbose=False, logger=None):
    
    if not verbose:
        logging.getLogger('requests').setLevel(logging.WARNING)

    format_ = '%(asctime)s %(levelname)-8s %(name)-40s %(message)s' if verbose else '%(message)s'
    level = logging.DEBUG if verbose else logging.INFO

    handler_stdout = logging.StreamHandler(sys.stdout)
    handler_stdout.setFormatter(logging.Formatter(format_))
    handler_stdout.setLevel(logging.DEBUG)
    handler_stdout.addFilter(InfoFilter())

    handler_stderr = logging.StreamHandler(sys.stderr)
    handler_stderr.setFormatter(logging.Formatter(format_))
    handler_stderr.setLevel(logging.WARNING)

    root_logger = logging.getLogger(logger)
    root_logger.setLevel(level)
    root_logger.addHandler(handler_stdout)
    root_logger.addHandler(handler_stderr)
1297768
def getLogger(name):
    '''  '''

    # Create logger and add a default NULL handler
    log = logging.getLogger(name)
    log.addHandler(_NullHandler())

    return log
932368
def _setup_logger(self):
        ''''''
        log = logging.getLogger('latexmk.py')

        handler = logging.StreamHandler()
        log.addHandler(handler)

        if self.opt.verbose:
            log.setLevel(logging.INFO)
        return log
169988
def _create_logger_(name):
    """"""
    logger = logging.getLogger(name)
    handler = logging.StreamHandler()
    handler.setFormatter(logging.Formatter('%(levelname)s %(message)s'))
    logger.addHandler(handler)
    logger.setLevel(logging.INFO)
    return logger
694893
def disable_logger(logger_name: str, propagate: bool = False):
    """"""
    log = logging.getLogger(logger_name)
    log.propagate = propagate
    for handler in log.handlers:
        log.removeHandler(handler)
957772
def create_logger(name, level='INFO'):
    
    formatter = ColorFormatter(LOG_FORMAT, DATE_FORMAT)
    if not isinstance(logging.getLevelName(level), int):
        level = 'INFO'
    handler = logging.StreamHandler()
    handler.setFormatter(formatter)
    logger = logging.getLogger(name)
    logger.setLevel(level)
    logger.addHandler(handler)
    return logger
70277
def enable_logging(self):
        
        handler = logging.FileHandler(self.log_fname)
        handler.setLevel(logging.INFO)
        run_id = self.id

        class WBFilter(logging.Filter):
            def filter(self, record):
                record.run_id = run_id
                return True

        formatter = logging.Formatter(
            '%(asctime)s %(levelname)-7s %(threadName)-10s:%(process)d [%(run_id)s:%(filename)s:%(funcName)s():%(lineno)s] %(message)s')
        handler.setFormatter(formatter)
        handler.addFilter(WBFilter())

        root = logging.getLogger()
        root.addHandler(handler)
200339
function initLogging (config) {
    // only create logger if custom logging enabled
    if (config.logger !== true) {
        return
    }
    // create new logger instance
    var logger = new winston.Logger()
    // add transport
    logger.add(winston.transports.Console, {
        formatter: winstonFormatter,
        level: 'info'
    });
    // make logger accessible
    config.logger = logger
    // override console.log function
    console.log = function () {
        logger.info.apply(logger, formatArgs(arguments))
    }
    // override console.info function
    console.info = function () {
        logger.info.apply(logger, formatArgs(arguments))
    }
    // override console.warn function
    console.warn = function () {
        logger.warn.apply(logger, formatArgs(arguments))
    }
    // override console.error function
    console.error = function () {
        logger.error.apply(logger, formatArgs(arguments))
    }
    // override console.debug function
    console.debug = function () {
        logger.debug.apply(logger, formatArgs(arguments))
    }
}
544263
function createLogger(name) {
    return (bunyan.createLogger({
        name: name,
        serializers: SERIALIZERS,
        streams: [
            {
                level: 'warn',
                stream: process.stderr
            },
            {
                level: 'debug',
                type: 'raw',
                stream: new RequestCaptureStream({
                    stream: process.stderr
                })
            }
        ]
    }));
}
52217
def _create_logger(name='did', level=None):
        
        # Create logger, handler and formatter
        logger = logging.getLogger(name)
        handler = logging.StreamHandler()
        handler.setFormatter(Logging.ColoredFormatter())
        logger.addHandler(handler)
        # Save log levels in the logger itself (backward compatibility)
        for level in Logging.LEVELS:
            setattr(logger, level, getattr(logging, level))
        # Additional logging constants and methods for details and data
        logger.DATA = LOG_DATA
        logger.DETAILS = LOG_DETAILS
        logger.ALL = LOG_ALL
        logger.details = lambda message: logger.log(
            LOG_DETAILS, message) # NOQA
        logger.data = lambda message: logger.log(
            LOG_DATA, message) # NOQA
        logger.all = lambda message: logger.log(
            LOG_ALL, message) # NOQA
        return logger