Return a logger with the specified name, creating it if necessary.
If no name is specified, return the root logger.

@function
@memberof module:py-logging
@param  {string} [name]
@return {Logger}
187588
function getLogger(name) {
	name = name || '';

	if (!name) {
		return Manager.root;
	} else {
		return Manager.getLogger(name);
	}
}
18503
def get_logger(
        name, file_name=None, stream=None, template=None, propagate=False):
    

    logger = logging.getLogger(name)

    if propagate is not None:
        logger.propagate = propagate

    for handler in logger.handlers:
        logger.removeHandler(handler)

    if not template:
        template = "%(name)s %(process)s %(levelname)s %(message)s"

    formatter = logging.Formatter(template)

    if not file_name and not stream:
        stream = sys.stdout

    handlers = []

    if stream is not None:

        handlers.append(logging.StreamHandler(stream=stream))

    if file_name is not None:

        if os.path.isdir(os.path.dirname(file_name)):
            handlers.append(logging.FileHandler(file_name))
        else:
            print("ERROR: Can't open log file {}".format(file_name))

    for ch in handlers:
        ch.setFormatter(formatter)
        logger.addHandler(ch)

    logger.setLevel(logging.INFO)

    return logger
1232507
def logger(self):
        
        if self._logger is None:
            self._logger = self.new_logger()
        return self._logger
1226183
public static synchronized PlatformLogger getLogger(String name) {
        PlatformLogger log = loggers.get(name);
        if (log == null) {
            log = new PlatformLogger(name);
            loggers.put(name, log);
        }
        return log;
    }
1060054
private static Logger getOrCreateLogger(final String name) {
		if (name == null || name.length() == 0) {
			return root;
		} else {
			Logger logger = loggers.get(name);
			if (logger == null) {
				Logger parent = getOrCreateLogger(reduce(name));
				logger = new Logger(parent, name);
				loggers.put(name, logger);
			}
			return logger;
		}
	}
658684
def get_logger(name=None, format_string=None):
    
    logging.captureWarnings(True)
    log = logging.getLogger(name)

    # Bind custom method to instance.
    # Source: https://stackoverflow.com/a/2982
    log.set_debug_level = _set_debug_level.__get__(log)
    log.set_debug_level(0)

    if not format_string:
        format_string = '[%(module)s]\t%(levelname)s\t%(message)s'

    # Setting up log formats
    log.handlers = []
    handler = logging.StreamHandler(sys.stderr)
    handler.setFormatter(
        logging.Formatter(format_string),
    )
    log.addHandler(handler)

    return log
1203239
def get_logger(name):
    """"""
    import logging
    import sys
    logger = logging.getLogger(name)
    logger.setLevel(logging.DEBUG)
    shandler = logging.StreamHandler(sys.stdout)
    fmt = ""
    fmt += '\033[1;32m%(levelname)-5s %(module)s:%(funcName)s():'
    fmt += '%(lineno)d %(asctime)s\033[0m| %(message)s'
    fmtr = logging.Formatter(fmt)
    shandler.setFormatter(fmtr)
    logger.addHandler(shandler)
    return logger
1060936
def getCustomLogger(name, logLevel, logFormat='%(asctime)s %(levelname)-9s:%(name)s:%(module)s:%(funcName)s: %(message)s'):
  '''
  
  '''
  assert isinstance(logFormat, basestring), ("logFormat must be a string but is %r" % logFormat)
  assert isinstance(logLevel, basestring), ("logLevel must be a string but is %r" % logLevel)
  assert isinstance(name, basestring), ("name must be a string but is %r" % name)

  validLogLevels = ['CRITICAL', 'DEBUG', 'ERROR', 'INFO', 'WARNING']

  if not logLevel:
    logLevel = 'DEBUG'

  # If they don't specify a valid log level, err on the side of verbosity
  if logLevel.upper() not in validLogLevels:
    logLevel = 'DEBUG'

  numericLevel = getattr(logging, logLevel.upper(), None)
  if not isinstance(numericLevel, int):
    raise ValueError("Invalid log level: %s" % logLevel)

  logging.basicConfig(level=numericLevel, format=logFormat)
  logger = logging.getLogger(name)
  return logger
494923
def get_logger(name, namespace='{{project.package}}',
               log_level=DEFAULT_LOG_LEVEL, log_dir=DEFAULT_LOG_DIR):
    """"""

    log_level = (os.getenv('{}_LOG_LEVEL'.format(namespace.upper())) or
                 os.getenv('LOG_LEVEL', log_level))
    log_dir = (os.getenv('{}_LOG_DIR'.format(namespace.upper())) or
               os.getenv('LOG_DIR', log_dir))

    logger = logging.getLogger('{}.{}'.format(namespace, name))
    logger.setLevel(log_level)

    formatter = logging.Formatter(
        '%(asctime)s - %(name)s - %(levelname)s - %(message)s')

    # Create a console stream handler
    console_handler = logging.StreamHandler()
    console_handler.setLevel(log_level)
    console_handler.setFormatter(formatter)
    logger.addHandler(console_handler)

    try:
        if log_dir:
            log_path = os.path.abspath(log_dir)
            log_filename = '{name}.{pid}.log'.format(
                name=namespace, pid=os.getpid())

            file_path = str(os.path.join(log_path, log_filename))

            if not os.path.exists(log_path):
                os.makedirs(log_path, mode=774)

            # Create a file handler
            file_handler = logging.FileHandler(file_path)
            file_handler.setLevel(log_level)
            file_handler.setFormatter(formatter)
            logger.addHandler(file_handler)
    except OSError as e:
        logger.error('Could not create log file {file}: {error}'.format(
            file=file_path, error=e.strerror))

    return logger
618995
def getLogger(name="anyconfig"):
    
    logger = logging.getLogger(name)
    logger.addHandler(anyconfig.compat.NullHandler())

    return logger
111454
def get_logger(name, CFG=None):
    

    logger = logging.getLogger(name)

    if CFG:
        # Make log directory if it doesn't exist
        for handler in CFG.get('handlers', {}).itervalues():
            if 'filename' in handler:
                log_dir = os.path.dirname(handler['filename'])
                if not os.path.exists(log_dir):
                    os.makedirs(log_dir)
        try:
            #TODO: This requires python 2.7
            logging.config.dictConfig(CFG)
        except AttributeError:
            print >> sys.stderr, '"logging.config.dictConfig" doesn\'t seem to be supported in your python'
            raise

    return logger
408999
public function getLogger($name = null)
    {
        $name = is_null($name) ? $this->defaultLogger : $name;
        $name = "{$this->getPrefix()}$name";
        if (!isset(static::$_loggers[$name])) {
            static::$_loggers[$name] = new Logger($name);
            $this->_setDefaultHandlers(static::$_loggers[$name]);
        }
        return static::$_loggers[$name];
    }
178587
function create (name, level) {
  name = name || 'karma'
  let logger
  if (loggerCache.hasOwnProperty(name)) {
    logger = loggerCache[name]
  } else {
    logger = log4js.getLogger(name)
    loggerCache[name] = logger
  }
  if (helper.isDefined(level)) {
    logger.setLevel(level)
  }
  return logger
}
225143
def get_logger(context=None, name=None):
    
    # Many class instances have their own logger. Share them to save memory if
    # possible, i.e. when *context* is not set.
    if name is None:
        name = _logger_name
    if context is None and name in _logger_dict:
        return _logger_dict[name]
    if context is not None and not isinstance(context, six.string_types):
        context = util.objref(context)
    logger = logging.getLogger(name)
    logger = ContextLogger(logger, context)
    if context is None:
        _logger_dict[name] = logger
    return logger
1262720
def get_logger(name):
    """"""
    logger = logging.getLogger(name)
    logger.setLevel(getenv('LOGLEVEL', 'INFO'))
    return logger
1066017
function makeLogger(level, method) {
	// The logger function to return takes a variable number of arguments
	// and formats like console.log
	function logger() {
		var args = [].slice.call(arguments);
		var format = level.toUpperCase() + ': (api-client) ' + args.shift();
		var logArgs = [format].concat(args);

		return console[method].apply(console, logArgs);
	}

	return (level === 'warn' || level === 'error' || level === 'info')
		? logger
		: function() {};
}
37971
def getLogger(name=None, filename=None, filemode=None, level=WARNING):
    
    warnings.warn("getLogger is deprecated, Use get_logger instead.",
                  DeprecationWarning, stacklevel=2)
    return get_logger(name, filename, filemode, level)