本文整理汇总了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();
}
}
示例2: getSQLLogger
protected function getSQLLogger()
{
if (!isset(static::$logger)) {
static::$logger = new DebugStack();
}
return static::$logger;
}
示例3: getLogger
public static function getLogger()
{
if (static::$logger) {
return static::$logger;
}
return static::$logger = new static();
}
示例4:
static function set_logger($logger)
{
if (!is_callable($logger)) {
return false;
}
static::$logger = $logger;
return true;
}
示例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();
}
示例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);
}
}
示例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__);
}
示例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);
}
示例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();
}
示例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;
}
示例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();
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}