/* Our awesome logger
507930
function Logger(config) {
    var self    = this;
    var config  = config || {};
    var options = config.options || {};
    var debug   = options.debug || false;
    var dev     = options.dev || false;
    var logging = config.logging || {};

    details = options.debugDetails || false;
    ignored = options.debugIgnore || [];

    if (typeof logging !== 'object') { logging = {}; }

    var enabled = typeof logging.enabled !== 'undefined' ? logging.enabled : false;
    var rewrite = typeof logging.rewrite !== 'undefined' ? logging.rewrite : true;
    var chat    = typeof logging.chat !== 'undefined' ? logging.chat : false;

    timestamp = typeof logging.timestamp !== 'undefined' ? logging.timestamp : true;

    this.options = {
        stream: process.stdout,
        wstream: null,
        level: 'raw'
    };

    if (debug && details) { this.options.level = 'chat'; }
    if (dev) { this.options.level = 'dev'; }
    if (!debug) { this.options.level = 'crash'; }

    if (enabled) {
        ensureExists('./logs', function(err) {
            if (!err) {
                var flag = rewrite ? 'w' : 'a';
                var stream = filesystem.createWriteStream('./logs/status.log', { flags: flag });
                self.options.wstream = stream;
                if (chat) { self.options.level = 'chat'; }
            }
        });
    }

    this.templates = {
        chat:  '[:timestamp] \x1b[35mchat\x1b[39m   - :message',
        action:  '[:timestamp] \x1b[35maction\x1b[39m - :message',
        dev:   '\x1b[90m  :message\x1b[39m',
        raw:   '[:timestamp] \x1b[36mraw\x1b[39m    - :message',
        event: '[:timestamp] \x1b[32mevent\x1b[39m  - :message',
        info:  '[:timestamp] \x1b[33minfo\x1b[39m   - :message',
        error: '[:timestamp] \x1b[31merror\x1b[39m  - :message',
        crash: '[:timestamp] \x1b[31merror\x1b[39m  - :message',
        inspect: true
    };
}
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;
}
451701
function print() {
    getLoggers().forEach(function (logger) {
        consoleAppender.log(formatText('Logger %b: %b, parent:%b', logger.name, logger.level, logger.parent));
    });
}
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]);
    });
  }
289366
function Logger(worker) {

  forEach([
    'start',
    'stop',
    'reschedule',
    'error',
    'poll',
    'poll:done',
    'poll:error',
    'fetchTasks',
    'fetchTasks:failed',
    'fetchTasks:success',
    'worker:register',
    'worker:remove',
    'executeTask',
    'executeTask:complete',
    'executeTask:complete:sent',
    'executeTask:failed',
    'executeTask:failed:sent',
    'executeTask:done',
    'executeTask:skip',
    'executeTasks',
    'executeTasks:done',
    'extendLock',
    'extendLock:success',
    'extendLock:failed',
  ], function(event) {

    worker.on(event, function(...args) {
      debug(event, ...args);
    });
  });

}
350289
function initFileLogger(filepath) {
  currentFilePath = filepath || currentFilePath;

  var logDir = path.dirname(currentFilePath);
  appenders.push(logToFile);
  if(!fs.existsSync(logDir)) fs.mkdirSync(logDir);
}
748738
function Logger(tags) {
    tags = parseTags(Array.prototype.slice.call(arguments));

    if (!(this instanceof Logger)) {
        return new Logger(tags);
    }

    this.tags = tags;
}
802645
function log () {
    if (argv.stdin && argv.fix) {
      arguments[0] = opts.cmd + ': ' + arguments[0]
      console.error.apply(console, arguments)
    } else {
      console.log.apply(console, arguments)
    }
  }
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
544259
function log(arg) {
  var str = JSON.stringify(arg)
  console.log(str)
  return str;
}
108658
private function logDir(): string
    {
        $logDir = str_replace(
                '{Y}',
                date('Y'),
                str_replace('{M}', date('m'), $this->logDir)
        );
        if (!file_exists($logDir)) {
            mkdir($logDir, $this->filemode, true);
        }

        return $logDir;
    }
523089
function logm() {
    var args = [].slice.call(arguments);
    var level = args.shift();
    if (logFor(level)) {
      var msg = args.shift();
      args.unshift(posix.getpid());
      args.unshift(level);
      args.unshift("[%s] m(%d): " + msg);
      logv(args);
    }
  }
368998
function log(text) {
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'success';
  var debug$$1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

  if (!debug$$1) {
    return;
  }

  var success = 'padding: 2px; background: #219621; color: #ffffff';
  var warning = 'padding: 2px; background: #f1e05a; color: #333333';
  var error = 'padding: 2px; background: #b9090b; color: #ffffff';
  var types = { error: error, success: success, warning: warning };

  console.log('%c [Storage Helper] ' + text + ' ', types[type]);
}
1264442
function loggerFactory(
    events,
    Constants,
    assert,
    _,
    util,
    stack,
    nconf
) {
    var levels = _.keys(Constants.Logging.Levels);

    function getCaller (depth) {
        var current = stack.get()[depth];

        var file = current.getFileName().replace(
            Constants.WorkingDirectory,
            ''
        ) + ':' + current.getLineNumber();

        return file.replace(/^node_modules/, '');
    }

    function Logger (module) {
        var provides = util.provides(module);

        if (provides !== undefined) {
            this.module = provides;
        } else {
            if (_.isFunction(module)) {
                this.module = module.name;
            } else {
                this.module = module || 'No Module';
            }
        }
    }

    Logger.prototype.log = function (level, message, context) {
        assert.isIn(level, levels);
        assert.string(message, 'message');

        // Exit if the log level of this message is less than the minimum log level.
        var minLogLevel = nconf.get('minLogLevel');
        if ((minLogLevel === undefined) || (typeof minLogLevel !== 'number')) {
            minLogLevel = 0;
        }
        if (Constants.Logging.Levels[level] < minLogLevel) {
            return;
        }

        events.log({
            name: Constants.Name,
            host: Constants.Host,
            module: this.module,
            level: level,
            message: message,
            context: context,
            timestamp: new Date().toISOString(),
            caller: getCaller(3),
            subject: 'Server'
        });
    };

    _.forEach(levels, function(level) {
        Logger.prototype[level] = function (message, context) {
            this.log(level, message, context);
        };
    });

    Logger.prototype.deprecate = function (message, frames) {
        console.error([
            'DEPRECATION:',
            this.module,
            '-',
            message,
            getCaller(frames || 2)
        ].join(' '));
    };

    Logger.initialize = function (module) {
        return new Logger(module);
    };

    return Logger;
}
539403
function log(err) {
    if (_logger) {
      if (typeof(err) == 'string') {
        err = { message: err, code: 0 }
      }
      _logger(err);
    }
  }
81837
public function logger()
    {
        if (is_null($this->logger)) {
            $this->logger = app(Logger::class);
        }

        return $this->logger;
    }
1374689
function Logger(level) {
    if (_.isString(level) && _.has(LogLevel, level)) {
        this.level = LogLevel[level];    
    } else if (_.isNumber(level) && level >= 0 && level <= 4) {
        this.level = level;
    } else {
        this.level = LogLevel.info;
    }    
}