Define the logger to use to log interesting events within the list
189430
public BlockingListMaker<K, E> log(Logger logger) {
        this.logger = logger == null ? NULL_LOGGER : logger;
        return this;
    }
176391
def logger_new (self, loggername, **kwargs):
        """"""
        args = self[loggername]
        args.update(kwargs)
        return self.loggers[loggername](**args)
893431
function LoggerContext() {
    LifeCycle.call(this);

    /**
     * Context start time
     */
    this.startTime = new Date();

    /**
     * The list of trace levels that the logger context knows about
     */
    this.logLevel = new LogLevel();

    /**
     * Root logger, final ancestor of all loggers
     */
    this.rootLogger = new Logger('[root]', this);

    /**
     * List of loggers that have been created, indexed by name.
     */
    this.loggers = {};

    /**
     * List of appenders that have been registered through a call to
     * "registerAppender", indexed by name.
     */
    this.appenders = {};

    /**
     * List of filters that have been registered through a call to
     * "registerFilter", indexed by name.
     */
    this.filters = {};

    /**
     * List of layouts that have been registered through a call to
     * "registerLayout", indexed by name.
     */
    this.layouts = {};

    /**
     * List of appenders that have been instantiated.
     *
     * The list is constructed when the configuration is applied. It is used
     * to start/stop appenders when corresponding functions are called on this
     * context.
     */
    this.createdAppenders = [];

    /**
     * The context-wide filter.
     *
     * The filter is constructed when the configuration is applied. If the
     * configuration specifies more than one context-wide filter, a
     * CompositeFilter filter is created.
     */
    this.filter = null;

    /**
     * Flag set when the context is up and running
     */
    this.started = false;

    /**
     * Log events received by the context before it got a chance to start and
     * that need to be processed as soon as the context is operational
     *
     * The context keeps a maximum of 1000 events in memory. If more events are
     * received before the context becomes operational, the context starts to
     * drop events, replacing the first event with a warning that events had to
     * be droppes. That warning is sent to the root logger.
     */
    this.pendingEvents = [];

    /**
     * Maximum number of log events that can be stored in the pending list.
     *
     * TODO: adjust this setting based on configuration settings.
     */
    this.maxPendingEvents = 1000;

    /**
     * Number of log events that had to be discarded so far
     */
    this.discardedPendingEvents = 0;
  }
70516
function Logger () {
  const levels = [
    'fatal', // 1
    'error', // 2
    'warn', // 3
    'info', // 4
    'debug' // 5
  ];
  let verbosity = 3;

  levels.forEach((level, idx) => {
    this[level] = (...params) => {
      if (idx + 1 <= verbosity) console.log(...params); // eslint-disable-line
    };
  });

  this.setLevel = (_) => {
    verbosity = _;
  };

  return this;
}
612996
def setup_logger(log=None, level=logging.INFO):
    
    if not log:
        log = logging.getLogger()
    if not log.handlers:
        channel = logging.StreamHandler()
        if level == logging.DEBUG:
            channel.setFormatter(DebugLogFormatter())
        else:
            channel.setFormatter(LogFormatter())

        log.setLevel(level)
        log.addHandler(channel)
874335
def get_logger(cls, custom_name=None):
        """"""
        name = custom_name or cls.get_name()
        return logging.getLogger(name)
545228
def setup_logger(log_dir=None, loglevel=logging.DEBUG):
    

    create_home_dir()
    create_dir(os.path.join(get_default_home_dir(), 'log'))

    if log_dir is None:
        log_dir = os.path.join(get_default_home_dir(), 'log')

    logger = logging.getLogger('ding0') # use filename as name in log
    logger.setLevel(loglevel)

    # create a file handler
    handler = logging.FileHandler(os.path.join(log_dir, 'ding0.log'))
    handler.setLevel(logging.DEBUG)
    formatter = logging.Formatter(
        '%(asctime)s-%(funcName)s-%(message)s (%(levelname)s)')
    handler.setFormatter(formatter)

    # create a stream handler (print to prompt)
    stream = logging.StreamHandler()
    stream.setLevel(logging.INFO)
    stream_formatter = logging.Formatter(
        '%(message)s (%(levelname)s)')
    stream.setFormatter(stream_formatter)

    # add the handlers to the logger
    logger.addHandler(handler)
    logger.addHandler(stream)

    logger.info('########## New run of Ding0 issued #############')

    return logger
816613
def init_logger():
    
    formatter = logging.Formatter('%(levelname)s: %(message)s')
    console = logging.StreamHandler(stream=sys.stdout)
    console.setLevel(logging.INFO)
    console.setFormatter(formatter)
    logger.addHandler(console)
772367
function Logger (context) {
    var loggerObj, i;

    if (!context || context.length === 0) {
        throw new Error("Invalid 'context' for Logger: " + context);
    }

    loggerObj = {
        debug   : function(scope, message) {
            console.debug(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        },
        info    : function(scope, message) {
            console.info(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        },
        warn    : function(scope, message) {
            console.warn(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        },
        error   : function(scope, message) {
            console.error(context + separator +
                scope +
                (message && message.length > 0 ? separator + message : "")
            );
        }
    };


    return loggerObj;
}
876993
def hasLogger(self, logger):
        
        if isinstance(logger, logging.Logger):
            logger = logging.name
        
        return logger in self._loggers
343592
function logger(type) {
    var args = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
    }
    var msg = args.shift();
    var fn = chek_1.isFunction(chek_1.last(args)) ? args.pop() : chek_1.noop;
    var meta = chek_1.isPlainObject(chek_1.last(args)) ? args.pop() : null;
    var obj = {
        type: type,
        msg: null,
        meta: meta
    };
    var formatters = chek_1.isString(msg) ? msg.match(/%/g) : null;
    if (formatters && formatters.length)
        msg = util_1.format.apply(void 0, [msg].concat(args));
    else
        msg = [msg].concat(args).join(' ');
    if (type === 'error' && !(msg instanceof Error)) {
        msg = new Error(msg);
        var stack = msg.stack.split('\n');
        var tmpMsg = stack.shift();
        stack.shift();
        stack.unshift(tmpMsg);
        msg.stack = stack.join('\n');
    }
    // If any error just throw it.
    if (msg instanceof Error) {
        if (fn)
            fn(msg, obj);
        msg.stack = msg.stack.split('\n').map(function (s, i) {
            if (i === 0)
                return colurs.applyAnsi('[error]', _log.colors.error) + ' ' + (msg.name || 'Error') + ': ' + msg.message;
            return s;
        }).join('\n');
        throw msg;
    }
    obj.msg = msg;
    fn(msg, obj);
    if (meta) {
        meta = util_1.inspect(meta, null, null, true);
        msg += ('\n' + meta);
    }
    if (type && _log.colors[type])
        msg = colurs.applyAnsi('[' + type + ']: ', _log.colors[type]) + msg;
    process.stderr.write(msg + '\n');
    return _log;
}
658082
function createLogger(fn) {
	return function () {
		var args = [],
			self = this,
			c;
		for (c = 0; c < arguments.length; c++) {
			args[c] = logger.specialObjectClone(arguments[c]);
		}
		return fn.apply(self, args);
	};
}
641051
def create_logger(name, formatter=None, handler=None, level=None):
    
    logger = logging.getLogger(name)

    #: remove existing handlers
    logger.handlers = []

    #: use a standard out handler
    if handler is None:
        handler = logging.StreamHandler(sys.stdout)

    #: set the formatter when a formatter is given
    if formatter is not None:
        handler.setFormatter(formatter)

    #: set DEBUG level if no level is specified
    if level is None:
        level = logging.DEBUG

    handler.setLevel(level)
    logger.setLevel(level)
    logger.addHandler(handler)
    return logger
1105234
def _log_changes(ret, changekey, changevalue):
    '''
    
    '''
    cl = ret['changes'].get('new', [])
    cl.append({changekey: _object_reducer(changevalue)})
    ret['changes']['new'] = cl
    return ret
1366966
def tail(conn, stack_name, log_func=_tail_print, sleep_time=5,
         include_initial=True):
    """"""
    # First dump the full list of events in chronological order and keep
    # track of the events we've seen already
    seen = set()
    initial_events = get_events(conn, stack_name)
    for e in initial_events:
        if include_initial:
            log_func(e)
        seen.add(e.event_id)

    # Now keep looping through and dump the new events
    while 1:
        events = get_events(conn, stack_name)
        for e in events:
            if e.event_id not in seen:
                log_func(e)
                seen.add(e.event_id)
        time.sleep(sleep_time)
1267593
def _logger(self):
        
        log_level = {
            'debug': logging.DEBUG,
            'info': logging.INFO,
            'warning': logging.WARNING,
            'error': logging.ERROR,
            'critical': logging.CRITICAL,
        }
        level = log_level.get(self.args.logging_level.lower())

        # Formatter
        tx_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s '
        tx_format += '(%(funcName)s:%(lineno)d)'
        formatter = logging.Formatter(tx_format)

        # Logger
        log = logging.getLogger('tcrun')

        # # Stream Handler
        # sh = logging.StreamHandler()
        # sh.set_name('sh')
        # sh.setLevel(level)
        # sh.setFormatter(formatter)
        # log.addHandler(sh)

        # File Handler
        if not os.access('log', os.W_OK):
            os.makedirs('log')
        logfile = os.path.join('log', 'run.log')
        fh = logging.FileHandler(logfile)
        fh.set_name('fh')
        fh.setLevel(logging.DEBUG)
        fh.setFormatter(formatter)
        log.addHandler(fh)

        log.setLevel(level)
        log.info('Logging Level: {}'.format(logging.getLevelName(level)))
        return log
179288
function Logger(manager, source) {
        Object.defineProperties(this, {
            "manager" : {
                value : manager,
                writable : false,
                enumerable : true
            },
            "source" : {
                value : source,
                writable : false,
                enumerable : true
            },
            "_timerData" : {
                value : {},
                writable : false,
                enumerable : false
            }
        });
    }