create a bunyan logger
@public
@function createLogger
@param    {String}     name of the logger
@returns  {Object}          bunyan logger
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
                })
            }
        ]
    }));
}
967776
def create_logger(name):
    
    logging.config.dictConfig({
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
            'simple': {
                'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
            },
            'detailed': {
                'format': '%(asctime)s %(module)-17s line:%(lineno)-4d '
                          '%(levelname)-8s %(message)s'
            },
            'email': {
                'format': 'Timestamp: %(asctime)s\nModule: %(module)s\n'
                          'Line: %(lineno)d\nMessage: %(message)s'
            },
        },
        'handlers': {
            # 'stream': {
            #     'level': 'DEBUG',
            #     'class': 'logging.StreamHandler',
            #     "formatter": "simple"
            # },
            "file": {
                "level": "DEBUG",
                "formatter": "simple",
                "class": "logging.handlers.RotatingFileHandler",
                "filename": "debug.log",
                'mode': 'a',
                'maxBytes': 30000,
                'backupCount': 0
            }
        },
        'loggers': {
            '': {
                # "handlers": ["stream", "file"],
                "handlers": ["file"],
                "level": "DEBUG",
                'propagate': True
            }
        }
    })
    return logging.getLogger(name)
428606
public static Logger createModuleLogger(String name, Logger parent) {
		final Logger logger = Logger.getLogger(name);
		if (parent != null) {
			logger.setParent(parent);
		}
		logger.setUseParentHandlers(true);
		final Level level = getLoggingLevelFromProperties();
		logger.setLevel(level);
		return logger;
	}
594823
public static Logger getLogger(String name) {
        ILoggerFactory iLoggerFactory = getILoggerFactory();
        return iLoggerFactory.getLogger(name);
    }
1307998
function loggerCreator(logger, options) {
  // debug('loggerCreator', options);
  if (!logger || !logger.error || !logger.warn || !logger.info) {
    throw new Error('logger, logger.error, logger.warn and logger.info are required');
  }
  const pOptions = fp.clone(options || {});
  const getExtraReqHeaders = getHeaderFields(pOptions.headers || []);
  return function bunyanMiddleware(req, res, next) {
    // debug('bunyanMiddleware', req.url);
    // attach the logger to req
    req.logger = logger;
    const startTime = process.hrtime();
    const logs = Object.assign({}, getRequestId(req));
    req.logs = {};
    res.logs = {};
    function logging() {
      // debug('bunyanMiddleware', 'logging', logs.req_id);
      const resLog = Object.assign(
        {},
        logs,
        getStatusCode(res),
        getMethod(req),
        getUrls(req),
        getReqIp(req),
        getResTime(startTime),
        getReqHttpVersion(req),
        { req_headers: Object.assign(
          {}, getExtraReqHeaders(req), getBasicReqHeaders(req)) },
        getReqQuery(req),
        // getReqParams(req),
        getReqPath(req),
        getReqLogs(req),
        getResLogs(res)
      );

      const logLevel = defaultLevelFn(resLog.statusCode);
      const logFn = logger[logLevel];
      logFn.call(logger, resLog);
    }
    res.once('finish', logging);
    res.once('close', logging);
    next();
  };
}
176919
def getLogger(name, level = logging.INFO):
        
        # create logger
        logger = logging.getLogger(name) 
        logger.setLevel(level)
        # create console handler and set level to debug
        ch = logging.StreamHandler()
        ch.setLevel(level)
        # create formatter
        formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
        # add formatter to ch
        ch.setFormatter(formatter)
        # add ch to logger
        logger.addHandler(ch)
        return logger
633042
function Log (name, opts) {
  if (!(this instanceof Log)) return new Log(name, opts)
  Object.assign(options,
    inspectOpts(process.env),
    inspectNamespaces(process.env)
  )
  LogBase.call(this, name, Object.assign({}, options, opts))
  const colorFn = (n) => chalk.hex(n)
  this.color = selectColor(name, colorFn)
  this.levColors = levelColors(colorFn)
  if (!this.opts.json) {
    this._log = this._logOneLine
  }
}
598007
public static Logger getLogger(String name) {
        Logger logger = Logger.getLogger(name);
        logger.setUseParentHandlers(false);
        for (Handler handler : logger.getHandlers()) {
            logger.removeHandler(handler);
        }
        // TODO when output log to the standard error
        Formatter formatter = new Formatter() {
            @Override
            public String format(LogRecord record) {
                long millis = record.getMillis();
                return String.format("[%tF %<tT.%<tL]%s%n", millis, record.getMessage());
            }
        };
        ConsoleHandler handler = new ConsoleHandler();
        handler.setFormatter(formatter);
        logger.addHandler(handler);
        if (loggerEnabled) {
            logger.setLevel(Level.INFO);
        } else {
            logger.setLevel(Level.OFF);
        }
        return logger;
    }
4500
protected static Logger getLogger(final String fqcn, final String name) {
        return factory.getContext(fqcn, null, null, false).getLogger(name);
    }
87567
function(name){
        const window = this.get(name);
        if(!window) return;

        return this.createNew(false, false, false, false, this.setup);
    }
950752
function logger(loggerName) {
    if (typeof loggerName === 'undefined') loggerName = 'default';
    if (typeof loggerMap[loggerName] !== 'undefined') return loggerMap[loggerName];
    const loggerObj = new ThorinLogger(loggerName);
    loggerMap[loggerName] = loggerObj;
    return loggerObj;
  }
64130
function _createLogger(log) {
    assert.optionalObject(log, 'log');

    if (log) {
        // TODO avoid this .child if already have the serializers, e.g. for
        // recursive call.
        return log.child({
            serializers: restifyClients.bunyan.serializers
        });
    } else {
        return bunyan.createLogger({
            name: 'registry',
            serializers: restifyClients.bunyan.serializers
        });
    }
}
982197
function createLoggers(ns) {
  var debug = (0, _debug2['default'])(ns + ':debug');
  debug.log = function () {
    return console.log.apply(console, arguments);
  };

  var log = (0, _debug2['default'])(ns + ':log');
  log.log = function () {
    return console.log.apply(console, arguments);
  };

  var info = (0, _debug2['default'])(ns + ':info');
  info.log = function () {
    return console.info.apply(console, arguments);
  };

  var warn = (0, _debug2['default'])(ns + ':warn');
  warn.log = function () {
    return console.warn.apply(console, arguments);
  };

  var error = (0, _debug2['default'])(ns + ':error');
  error.log = function () {
    return console.error.apply(console, arguments);
  };

  return {
    debug: debug,
    log: log,
    info: info,
    warn: warn,
    error: error
  };
}
946599
def get_logger_by_name(name=None, rand_name=False, charset=Charset.HEX):
    
    if rand_name:
        name = rand_str(charset)
    logger = logging.getLogger(name)
    return logger
588015
function logger(globalName) {
  return function() {
    var args = Array.prototype.slice.call(arguments, 0);
    var global = globalName || pkg.name;

    return debug(
      args.length > 0 ?
      [global, args.join(':')].join(':') :
      global
    )
  }
}
992961
public static org.slf4j.Logger getLogger(String name, String appname) {
        //从"com/alipay/sofa/rpc/log"中获取 rpc 的日志配置并寻找对应logger对象,log 为默认添加的后缀
        if (name == null || name.isEmpty()) {
            return null;
        }

        Map<String, String> properties = new HashMap<String, String>();
        properties.put(APPNAME, appname == null ? "" : appname);
        SpaceId spaceId = new SpaceId(RPC_LOG_SPACE);
        if (appname != null) {
            spaceId.withTag(APPNAME, appname);
        }
        return LoggerSpaceManager.getLoggerBySpace(name, spaceId, properties);
    }
1157353
def create_logger(name):
  
  base = logging.getLogger("cleverhans")
  if len(base.handlers) == 0:
    ch = logging.StreamHandler()
    formatter = logging.Formatter('[%(levelname)s %(asctime)s %(name)s] ' +
                                  '%(message)s')
    ch.setFormatter(formatter)
    base.addHandler(ch)

  return base