Get a singleton Log Class
Acces to Module Logging Functions

@return Logger
195380
public static function log()
    {
        if (!isset(self::core()->log)) {
            //====================================================================//
            // Initialize Log & Debug
            self::core()->log = new Logger();

            //====================================================================//
            //  Define Standard Messages Prefix if Not Overiden
            if (isset(self::configuration()->localname)) {
                self::core()->log->setPrefix(self::configuration()->localname);
            }
        }

        return self::core()->log;
    }
484807
public final Logger getLogger()
    {
        if (logger == null)
        {
            logger = LoggerFactory.getLogger(clazz);
        }
        if (logger instanceof LocationAwareLogger)
        {
            return new LocationAwareWrapper(FQCN, (LocationAwareLogger) logger);
        }
        return this.logger;
    }
143254
public static function getLogger()
    {
        if (!self::$_logger) {
            if ($zfdebug = Zend_Controller_Front::getInstance()->getPlugin('ZFDebug_Controller_Plugin_Debug')) {
                self::$_logger = $zfdebug->getPlugin('Log')->getLog();
            } else {
                return false;
            }
        }
        return self::$_logger;
    }
152797
public function loggerFactory()
	{
		if(!isset($this->_loggerFactory))
		{
			$this->_loggerFactory = new Logging\DefaultLoggerFactory();
		}

		return $this->_loggerFactory;
	}
112697
public function getLogger()
    {
        if ($this->logger instanceof LoggerInterface) {
            return $this->logger;
        }
        if ($this instanceof ServiceLocatorAwareInterface) {
            $logger = $this->getServiceLocator()->get(LoggerService::SERVICE_ID);
        } else {
            $logger = ServiceManager::getServiceManager()->get(LoggerService::SERVICE_ID);
        }
        return ($logger instanceof LoggerInterface) ? $logger : new NullLogger();
    }
70982
public function getLogBuilder()
    {
        if (!is_object($this->_logBuilder)) {
            $this->_logBuilder = Yii::createObject($this->_logBuilder);
        }
        return $this->_logBuilder;
    }
785001
protected function getLogger()
    {
        if ($this->logger) {
            return $this->logger;
        }

        // Set logger for this job
        $this->logger = $this
            ->getLoggerFactory()
            ->getQueuedJobLogger($this);
        return $this->logger;
    }
67417
private function createLogger()
    {
        if ($this->silent) {
            $logger = new SilentLogger();
            self::$msgOutputLevel = Project::MSG_WARN;
        } elseif ($this->loggerClassname !== null) {
            self::import($this->loggerClassname);
            // get class name part
            $classname = self::import($this->loggerClassname);
            $logger = new $classname();
            if (!($logger instanceof BuildLogger)) {
                throw new BuildException($classname . ' does not implement the BuildLogger interface.');
            }
        } else {
            $logger = new DefaultLogger();
        }
        $logger->setMessageOutputLevel(self::$msgOutputLevel);
        $logger->setOutputStream(self::$out);
        $logger->setErrorStream(self::$err);
        $logger->setEmacsMode($this->emacsMode);

        return $logger;
    }
293252
private function getDispatcher() {
        if (is_null($this->dispatcher)) {
            $this->dispatcher = new \common_log_Dispatcher($this->getOption(self::OPTION_APPENDERS));
        }
        return $this->dispatcher;
    }
760924
public static function getInstance()
    {
        $class = get_called_class();

        if (!isset(self::$instances[$class])) {
            $container = StaticContainer::getContainer();

            $refl = new \ReflectionClass($class);

            if (!$refl->getConstructor() || $refl->getConstructor()->isPublic()) {
                self::$instances[$class] = $container->get($class);
            } else {
                /** @var LoggerInterface $logger */
                $logger = $container->get('Psr\Log\LoggerInterface');

                // BC with API defining a protected constructor
                $logger->notice('The API class {class} defines a protected constructor which is deprecated, make the constructor public instead', array('class' => $class));
                self::$instances[$class] = new $class;
            }
        }

        return self::$instances[$class];
    }
874335
def get_logger(cls, custom_name=None):
        """"""
        name = custom_name or cls.get_name()
        return logging.getLogger(name)
118702
public function getLogger()
    {
        if (!$this->logger) {
            if (!defined('STDERR')) {
                // See testGetLoggerRunFromStdin
                // @codeCoverageIgnoreStart
                define('STDERR', fopen('php://stderr', 'w'));
            }
            // @codeCoverageIgnoreEnd
            $handler = new StreamHandler(STDERR, Logger::DEBUG);
            $handler->setFormatter(new LineFormatter("%datetime% %level_name% %message% %context%\n"));
            $this->logger = new Logger(get_class($this));
            $this->logger->pushHandler($handler);
        }
        return $this->logger;
    }
172224
public function create() : LoggerInterface
    {
        $loggerType = $this->config['type'] ?? 'null';
        switch ($loggerType) {
            case 'file':
                return new Logger($this->config['path'], $this->config['level']);
            case 'null':
                return new NullLogger;
            default:
                throw new \RuntimeException('Invalid logger type');
        }
    }
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)
1145962
protected function loadLogger()
    {
        $logger = null;
        if ($this->hasOption(self::LOGGER_OPTION)) {
            $loggerOptions = $this->getOption(self::LOGGER_OPTION);
            if (is_object($loggerOptions)) {
                if (is_a($loggerOptions, LoggerInterface::class)) {
                    $logger = $loggerOptions;
                }
            } elseif (is_array($loggerOptions) && isset($loggerOptions['class'])) {
                $classname = $loggerOptions['class'];
                if (is_a($classname, LoggerInterface::class, true)) {
                    if (isset($loggerOptions['options'])) {
                        $logger = new $classname($loggerOptions['options']);
                    } else {
                        $logger = new $classname();
                    }
                }
            }
        }

        if (!is_null($logger)) {
            $this->logger = $logger;
        } else {
            $this->logger = new NullLogger();
        }

        return $this->logger;
    }
35934
protected function newLoggerHandlerImpl()
    {
        $config  = $this->get('config');
        $factory = $config->get('psx_logger_factory');

        if ($factory instanceof \Closure) {
            return $factory($config);
        } else {
            $level = $config->get('psx_log_level');
            $level = !empty($level) ? $level : Logger::ERROR;

            $handler = new ErrorLogHandler(ErrorLogHandler::OPERATING_SYSTEM, $level, true, true);
            $handler->setFormatter(new ErrorFormatter());

            return $handler;
        }
    }
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