Creates a logger with the given name.
    :param name: name of the logger (gets prefixed with the package name)
    :return: the created logger
543812
def create_logger(name: str) -> Logger:
    
    logger = logging.getLogger(f"{PACKAGE_NAME}.{name}")
    logger.addHandler(StreamHandler())
    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
237700
def getLogger(name=None):

    '''
    
    '''

    logger = logging.getLogger(name=name)

    if not hasattr(logger, 'd'):
        def d(self, msg, *args, **kwargs):
            return self.log(DEBUG, msg, *args, **kwargs)
        logger.d = types.MethodType(d, logger)

    if not hasattr(logger, 'v'):
        def v(self, msg, *args, **kwargs):
            return self.log(VERBOSE, msg, *args, **kwargs)
        logger.v = types.MethodType(v, logger)

    if not hasattr(logger, 'i'):
        def i(self, msg, *args, **kwargs):
            return self.log(INFO, msg, *args, **kwargs)
        logger.i = types.MethodType(i, logger)

    if not hasattr(logger, 'w'):
        def w(self, msg, *args, **kwargs):
            return self.log(WARN, msg, *args, **kwargs)
        logger.w = types.MethodType(w, logger)

    if not hasattr(logger, 'e'):
        def e(self, msg, *args, **kwargs):
            return self.log(ERROR, msg, *args, **kwargs)
        logger.e = types.MethodType(e, logger)

    return logger
169009
def get_logger(name):
        """"""
        if name is None:
            return NoLogger()

        logger = logging.getLogger(name)
        if Logger.use_external_configuration:
            logger.propagate = False
        return logger
1120373
def get_logger(name=None):
    '''
    
    '''
    logger = logging.getLogger(name)
    if len(logger.handlers) == 0:
        logger = add_stream_handler(logger)
    return logger
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;
  }
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
87259
def getLoggerWithConsoleHandler(logger_name=None):
    
    logger = logging.getLogger(logger_name)
    logger.setLevel(logging.INFO)
    if not logger.handlers:
        handler = logging.StreamHandler(sys.stdout)
        if sys.platform == 'win32':
            formatter = logging.Formatter(
                            fmt="%(asctime)s %(name)s %(message)s",
                            datefmt='%H:%M:%S')
        else:
            formatter = ColorFormatter(fmt="$RESET %(asctime)s "
                                       "$BOLD$COLOR%(name)s$RESET "
                                       "%(message)s", datefmt='%H:%M:%S')
        handler.setFormatter(formatter)
        logger.addHandler(handler)
    return logger
663580
@Override
  public Logger getLogger(String name) {
    String tag = createTag(name);
    Logger logger = loggerMap.get(tag);
    if (logger == null) {
      Logger newInstance = new TimberLoggerAdapter(tag);
      Logger oldInstance = loggerMap.putIfAbsent(tag, newInstance);
      logger = oldInstance == null ? newInstance : oldInstance;
    }
    return logger;
  }
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
1042749
@Override
    public Logger getLogger(String name) {
        Logger logger = loggerMap.get(name);
        if (logger != null)
            return logger;
        Logger newInstance = new LCLogger(name, LCCore.getApplication().getLoggerFactory().getLogger(name));
        Logger oldInstance = loggerMap.putIfAbsent(name, newInstance);
        return oldInstance == null ? newInstance : oldInstance;
    }
1246509
def setup_custom_logger(name):
    
    global loggers

    if loggers.get(name):
        return loggers.get(name)

    formatter = logging.Formatter(
        fmt='%(levelname)s: %(message)s'
    )

    # handler = logging.StreamHandler()
    handler = TqdmLoggingHandler()
    handler.setFormatter(formatter)

    # \033[1;30m - black
    # \033[1;31m - red
    # \033[1;32m - green
    # \033[1;33m - yellow
    # \033[1;34m - blue
    # \033[1;35m - magenta
    # \033[1;36m - cyan
    # \033[1;37m - white

    if system() not in ['Windows', 'cli']:
        logging.addLevelName(logging.ERROR, "\033[1;31m%s\033[1;0m" % logging.getLevelName(logging.ERROR))
        logging.addLevelName(logging.WARNING, "\033[1;33m%s\033[1;0m" % logging.getLevelName(logging.WARNING))
        logging.addLevelName(logging.INFO, "\033[1;34m%s\033[1;0m" % logging.getLevelName(logging.INFO))
        logging.addLevelName(logging.DEBUG, "\033[1;35m%s\033[1;0m" % logging.getLevelName(logging.DEBUG))

    logger = logging.getLogger(name)
    logger.setLevel(logging.WARNING)

    # if (logger.hasHandlers()):
    #     logger.handlers.clear()
    if logger.handlers:
        logger.handlers = []
    logger.addHandler(handler)
    loggers.update(dict(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
376058
def getLogger(name=None):
    

    if name:
        logger = SLogger.manager.getLogger(name)
        return logger
    else:
        return rootLogger
667322
def get_logger(name='', log_stream=None, log_file=None,
               quiet=False, verbose=False):
    """"""

    # configure root logger
    log_level = logging.INFO
    if quiet:
        log_level = logging.WARNING
    elif verbose:
        log_level = logging.DEBUG

    if log_stream is None:
        log_stream = sys.stdout

    new_logger = configure_logger(name, log_stream=log_stream,
                                  log_file=log_file, log_level=log_level)

    return new_logger
530914
protected Logger wrap(String name, org.slf4j.Logger implementation) {
		return new Slf4jLogger(name, implementation);
	}
280952
def getLogger(name=None, **kwargs):
    
    adapter = _LOGGERS.get(name)
    if not adapter:
        # NOTE(jd) Keep using the `adapter' variable here because so it's not
        # collected by Python since _LOGGERS contains only a weakref
        adapter = KeywordArgumentAdapter(logging.getLogger(name), kwargs)
        _LOGGERS[name] = adapter
    return adapter