当前位置: 首页>>代码示例>>PHP>>正文


PHP static::logger方法代码示例

本文整理汇总了PHP中static::logger方法的典型用法代码示例。如果您正苦于以下问题:PHP static::logger方法的具体用法?PHP static::logger怎么用?PHP static::logger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在static的用法示例。


在下文中一共展示了static::logger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct()
 {
     $this->config = core_config();
     if (is_null(static::$logger)) {
         static::$logger = new Logger('ingest');
         $logname = core_config('logs.path') . DS . 'activity.log';
         static::$logger->pushHandler(new StreamHandler($logname, Logger::DEBUG));
     }
     if (is_null(static::$manager)) {
         if (core_config()->has('default.local') && core_config()->has('staging.local')) {
             $default = new Local(core_config('default.local'));
             $staging = new Local(core_config('staging.local'));
             $public = new Local(core_config('public.local'));
             $defaultIfc = new Filesystem($default);
             $stagingIfc = new Filesystem($staging);
             $publicIfc = new Filesystem($public);
         } else {
             print "The system is not fully configured: default.local and staging.local must both be set.\n";
             return false;
         }
         static::$manager = new MountManager(['default' => $defaultIfc, 'staging' => $stagingIfc, 'public' => $publicIfc]);
         static::$logger->addInfo(__CLASS__ . '::' . __FUNCTION__ . ': ========= MARK: INIT =========');
     }
     if (is_null(static::$disk)) {
         $this->initDiskMap();
     }
 }
开发者ID:roaringsky,项目名称:repose-core,代码行数:27,代码来源:ServiceClass.php

示例2: getSQLLogger

 protected function getSQLLogger()
 {
     if (!isset(static::$logger)) {
         static::$logger = new DebugStack();
     }
     return static::$logger;
 }
开发者ID:glynnforrest,项目名称:active-doctrine,代码行数:7,代码来源:FunctionalTestCase.php

示例3: getLogger

 public static function getLogger()
 {
     if (static::$logger) {
         return static::$logger;
     }
     return static::$logger = new static();
 }
开发者ID:nbey,项目名称:Emergence-Skeleton,代码行数:7,代码来源:Logger.php

示例4:

 static function set_logger($logger)
 {
     if (!is_callable($logger)) {
         return false;
     }
     static::$logger = $logger;
     return true;
 }
开发者ID:RogerBaklund,项目名称:LayoutProcessor,代码行数:8,代码来源:LayoutProcessor.class.php

示例5: __construct

 /**
  * @param string $logFile
  * @param bool   $logDebug
  *
  * @throws \RuntimeException
  */
 public function __construct($logFile, $logDebug = false)
 {
     if (static::$logger instanceof MainLogger) {
         throw new \RuntimeException("MainLogger has been already created");
     }
     static::$logger = $this;
     $this->logStream = \ThreadedFactory::create();
     $this->start();
 }
开发者ID:TylerAndrew,项目名称:Steadfast2,代码行数:15,代码来源:MainLogger.php

示例6: init

 private static function init()
 {
     if (static::$logger === null) {
         $config = Kernel::getConfig('log', array('class' => 'PFinal\\Wechat\\Support\\Logger'));
         $class = $config['class'];
         unset($config['class']);
         static::$logger = new $class($config);
     }
 }
开发者ID:pfinal,项目名称:wechat,代码行数:9,代码来源:Log.php

示例7: array

 function __construct($login = null, $password = null, $options = array())
 {
     $this->login = $login;
     $this->password = $password;
     if ($options) {
         $this->setOptions($options);
     }
     static::$logger = Logger::getLogger(__CLASS__);
 }
开发者ID:qshurick,项目名称:auth,代码行数:9,代码来源:SimpleAdapter.php

示例8: __construct

 /**
  * WPLogger constructor.
  * インスタンスの初期化
  */
 private function __construct()
 {
     static::$path = get_template_directory() . '/logs/debug.log';
     static::$logger = new Logger('wptheme');
     $output = "[%datetime%] %level_name%: %message% %context% %extra%\n";
     $formatter = new LineFormatter($output);
     $stream = new StreamHandler(static::$path, Logger::DEBUG);
     $stream->setFormatter($formatter);
     static::$logger->pushHandler($stream);
 }
开发者ID:1shiharat,项目名称:wp-debugging,代码行数:14,代码来源:class-wp-logger.php

示例9: getLogger

 /**
  * @return Logger
  */
 public static function getLogger()
 {
     if (!static::$logger) {
         static::$logger = new Logger(static::$logDirectory, static::$email, static::getBlueScreen());
         static::$logger->directory =& Tracy\Debugger::$logDirectory;
         // back compatiblity
         static::$logger->email =& Tracy\Debugger::$email;
         Tracy\Debugger::setLogger(static::$logger);
     }
     return Tracy\Debugger::getLogger();
 }
开发者ID:trejjam,项目名称:utils,代码行数:14,代码来源:Debugger.php

示例10: build

 public static function build(array $data)
 {
     $obj = new static($data);
     if (!$obj->logger()) {
         throw new \InvalidArgumentException("logger may not be empty");
     }
     if (!$obj->m()) {
         throw new \InvalidArgumentException("mapperBuilder may not be empty");
     }
     return $obj;
 }
开发者ID:godentarek,项目名称:whathood,代码行数:11,代码来源:AbstractJob.php

示例11: __construct

 /**
  * @param string $logFile
  * @param bool   $logDebug
  *
  * @throws \RuntimeException
  */
 public function __construct($logFile, $logDebug = false)
 {
     if (static::$logger instanceof MainLogger) {
         throw new \RuntimeException("MainLogger has been already created");
     }
     static::$logger = $this;
     touch($logFile);
     $this->logFile = $logFile;
     $this->logDebug = (bool) $logDebug;
     $this->logStream = new \Threaded();
     $this->start();
 }
开发者ID:iTXTech,项目名称:Genisys,代码行数:18,代码来源:MainLogger.php

示例12: log

 /**
  * @param null $object
  * @param $level
  * @param $message
  * @param array $context
  * @return null
  */
 public static function log($object = null, $level, $message, $context = [])
 {
     if (is_object($object)) {
         $className = get_class($object);
         $pid = getmypid();
         $message = "[{$className} {$pid}] {$message}";
     }
     if (static::$logger == null) {
         static::$logger = new ConsoleLogger();
     }
     return static::$logger->log($level, $message, $context);
 }
开发者ID:voryx,项目名称:thruway,代码行数:19,代码来源:Logger.php

示例13: __construct

 /**
  * @param string $logFile
  * @param bool   $logDebug
  *
  * @throws \RuntimeException
  */
 public function __construct($logFile, $logDebug = false)
 {
     if (static::$logger instanceof MainLogger) {
         throw new \RuntimeException("MainLogger has been already created");
     }
     static::$logger = $this;
     $this->enabled = false;
     file_put_contents($logFile, "", FILE_APPEND);
     $this->logFile = $logFile;
     $this->logDebug = (bool) $logDebug;
     $this->logStream = new \Threaded();
     $this->start();
 }
开发者ID:ClearSkyTeam,项目名称:ClearSky,代码行数:19,代码来源:MainLogger.php

示例14: __construct

 /**
  * @param string $logFile
  * @param bool   $hasANSI
  * @param bool   $logDebug
  *
  * @throws \RuntimeException
  */
 public function __construct($logFile, $hasANSI = false, $logDebug = false)
 {
     if (static::$logger instanceof MainLogger) {
         throw new \RuntimeException("MainLogger has been already created");
     }
     static::$logger = $this;
     \touch($logFile);
     $this->logFile = $logFile;
     $this->hasANSI = (bool) $hasANSI;
     $this->logDebug = (bool) $logDebug;
     $this->logStream = "";
     $this->start(PTHREADS_INHERIT_NONE);
 }
开发者ID:Hydreon,项目名称:PMSoft238,代码行数:20,代码来源:MainLogger.php

示例15: getInstance

 /**
  * @return Esendex_Sms_Model_Logger_Logger
  */
 public static function getInstance()
 {
     if (static::$logger) {
         return static::$logger;
     }
     $file = sprintf('%s/%s', Mage::getBaseDir('log'), static::LOG_FILE);
     $logger = new Zend_Log(new Zend_Log_Writer_Stream($file));
     if (!Mage::getStoreConfig('esendex_sms/sms/debug_mode')) {
         $logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::CRIT));
     }
     static::$logger = new Esendex_Sms_Model_Logger_Logger($logger);
     return static::$logger;
 }
开发者ID:WeareJH,项目名称:esendex-magento-extension,代码行数:16,代码来源:Factory.php


注:本文中的static::logger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。