Instantiate new logger and return it.
176391
def logger_new (self, loggername, **kwargs):
        """"""
        args = self[loggername]
        args.update(kwargs)
        return self.loggers[loggername](**args)
528227
def initLogger():
    '''
    
    '''
    global logger
    logger = logging.getLogger('root')
    logger.setLevel(logging.DEBUG)
    ch = logging.StreamHandler(sys.stdout)
    ch.setLevel(logging.INFO)
    formatter = logging.Formatter("[%(asctime)s] %(levelname)s: %(message)s", "%Y-%m-%d %H:%M:%S")
    ch.setFormatter(formatter)
    logger.addHandler(ch)
459050
def _init_log(level=logging.DEBUG):
    
    log = logging.getLogger(__file__)
    log.setLevel(level)
    handler = logging.StreamHandler(sys.stdout)
    handler.setLevel(level)
    formatter = logging.Formatter('%(asctime)s: %(message)s',
                                  '%Y/%m/%d-%H:%M:%S')
    handler.setFormatter(formatter)
    log.addHandler(handler)
    return log
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
450070
public static Logger getLogger(Class<?> cls,
                                   String resourcename,
                                   String loggerName) {
        return createLogger(cls, resourcename, loggerName);
    }
1046859
def create_logger(app: 'Quart') -> Logger:
    
    logger = getLogger('quart.app')

    if app.debug and logger.level == NOTSET:
        logger.setLevel(DEBUG)

    logger.addHandler(default_handler)
    return logger
237895
def logger(self):
        """"""
        if not self.is_main:
            return self.main.logger
        try:
            return self._logger
        except AttributeError:
            name = '%s.%s.%s' % (self.__module__, self.__class__.__name__,
                                 self.num)
            self._logger = logging.getLogger(name)
            self.logger.debug('Initializing...')
            return self._logger
1365678
private function initializeLogger()
    {
        if (Log::hasLogger()) {
            return;
        }

        $logger = new Logger($this->getConfig()['log']['name'] ?? 'foundation');

        if (!$this->getConfig()['debug'] ?? false || defined('PHPUNIT_RUNNING')) {
            $logger->pushHandler(new NullHandler());
        } elseif (($this->getConfig()['log']['handler'] ?? null) instanceof HandlerInterface) {
            $logger->pushHandler($this->getConfig()['log']['handler']);
        } elseif ($logFile = $this->getConfig()['log']['file'] ?? null) {
            $logger->pushHandler(new StreamHandler(
                    $logFile,
                    $this->getConfig()['log']['level'] ?? Logger::WARNING,
                    true,
                    $this->getConfig()['log']['permission'] ?? null
            ));
        }

        Log::setLogger($logger);
    }
1232507
def logger(self):
        
        if self._logger is None:
            self._logger = self.new_logger()
        return self._logger
1359688
def get_logger(name):
    """"""
    if not hasattr(logging.Logger, 'trace'):
        logging.addLevelName(TRACE_LEVEL, 'TRACE')

        def trace(self, message, *args, **kwargs):
            if self.isEnabledFor(TRACE_LEVEL):
                # Yes, logger takes its '*args' as 'args'.
                self._log(TRACE_LEVEL, message, args, **kwargs)

        logging.Logger.trace = trace

    log = logging.getLogger(name)
    if not log.handlers:
        log.addHandler(logging.NullHandler())
    return log
521903
private static function createDefaultLogger()
    {
        $log = new Logger('ZCrawler');

        if (defined('PHPUNIT_RUNNING')) {
            $log->pushHandler(new NullHandler());
        } else {
            $log->pushHandler(new ErrorLogHandler());
        }

        return $log;
    }
873582
def logger(self):
        """"""
        try:
            return self.data.psy.logger.getChild(self.__class__.__name__)
        except AttributeError:
            name = '%s.%s' % (self.__module__, self.__class__.__name__)
            return logging.getLogger(name)
182433
private Logger createLoggerInstance(String loggerName) throws Exception
    {
        Class loggerClass = getConfiguration().getLoggerClass();
        Logger log = (Logger) ClassHelper.newInstance(loggerClass, String.class, loggerName);
        log.configure(getConfiguration());
        return log;
    }
333619
def setup_logger():
    """"""
    formatter = ColoredFormatter(
        "%(log_color)s%(levelname)-8s%(reset)s %(blue)s%(message)s",
        datefmt=None,
        reset=True,
        log_colors={
            'DEBUG':    'cyan',
            'INFO':     'green',
            'WARNING':  'yellow',
            'ERROR':    'red',
            'CRITICAL': 'red',
        }
    )

    logger = logging.getLogger('example')
    handler = logging.StreamHandler()
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    logger.setLevel(logging.DEBUG)

    return logger
402971
private Logger createLogger() {
    String loggerName = String.format("%s.%s.Script", project.getGroupId(), project.getArtifactId());
    return LoggerFactory.getLogger(loggerName);
  }
148476
def get_logger(name):
    """"""
    logger = logging.getLogger(name)
    logger.setLevel(logging.INFO)

    # File output handler
    file_handler = logging.FileHandler(log_path)
    file_handler.setLevel(logging.INFO)
    formatter = logging.Formatter(
        '%(asctime)s %(name)12s %(levelname)8s %(lineno)s %(message)s',
        datefmt='%m/%d/%Y %I:%M:%S %p')
    file_handler.setFormatter(formatter)

    logger.addHandler(file_handler)
    return logger
385625
def logger(self):
        """"""
        if self._experiment:
            return logging.getLogger('.'.join([self.name, self.experiment]))
        elif self._projectname:
            return logging.getLogger('.'.join([self.name, self.projectname]))
        else:
            return logging.getLogger('.'.join([self.name]))