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


PHP Logger::getName方法代码示例

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


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

示例1: addDBHandler

 /**
  * @param resource $stream
  * @param integer  $level  The minimum logging level at which this handler will be triggered
  * @param Boolean  $bubble Whether the messages that are handled can bubble up the stack or not
  */
 public function addDBHandler($stream = null, $level = \Monolog\Logger::DEBUG, $bubble = true)
 {
     if (empty($stream)) {
         $stream = new DBHandler($this->logger->getName() . '_log', $level, $bubble);
     }
     $this->logger->pushHandler($stream);
 }
开发者ID:panvagenas,项目名称:wp-plugin-core,代码行数:12,代码来源:Logger.php

示例2: addLogger

 /**
  * Adds new logging channel to the registry
  *
  * @param  Logger      $logger    Instance of the logging channel
  * @param  string|null $name      Name of the logging channel ($logger->getName() by default)
  * @param  boolean     $overwrite Overwrite instance in the registry if the given name already exists?
  * @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists
  */
 public static function addLogger(Logger $logger, $name = null, $overwrite = false)
 {
     $name = $name ?: $logger->getName();
     if (isset(self::$loggers[$name]) && !$overwrite) {
         throw new InvalidArgumentException('Logger with the given name already exists');
     }
     self::$loggers[$name] = $logger;
 }
开发者ID:adrianoaguiar,项目名称:magento-elasticsearch-module,代码行数:16,代码来源:Registry.php

示例3: testWithName

 /**
  * @covers Monolog\Logger::withName
  */
 public function testWithName()
 {
     $first = new Logger('first', array($handler = new TestHandler()));
     $second = $first->withName('second');
     $this->assertSame('first', $first->getName());
     $this->assertSame('second', $second->getName());
     $this->assertSame($handler, $second->popHandler());
 }
开发者ID:jorjoh,项目名称:Varden,代码行数:11,代码来源:LoggerTest.php

示例4: configureHandlers

 /**
  * @param Logger $Logger Logger to configure
  * @param array $config handlers configuration
  *
  * @throws HandlerClassMissingException
  * @throws SectionArgsMissingException
  */
 protected function configureHandlers(Logger $Logger, array $config)
 {
     foreach ($config as $handlerConfig) {
         if (!isset($handlerConfig[Config::HANDLER_CLASS])) {
             throw new HandlerClassMissingException('Handler class is missing for [' . $Logger->getName() . '] log');
         }
         if (!isset($handlerConfig[Config::HANDLER_ARGS])) {
             throw new SectionArgsMissingException('Section args is missing for [' . $Logger->getName() . '] log');
         }
         $Reflector = new ReflectionClass($handlerConfig[Config::HANDLER_CLASS]);
         /** @var HandlerInterface $AbstractHandler */
         $AbstractHandler = $Reflector->newInstanceArgs($handlerConfig[Config::HANDLER_ARGS]);
         if (isset($handlerConfig[Config::HANDLER_FORMATTER])) {
             $this->configureFormatter($Logger, $AbstractHandler, $handlerConfig[Config::HANDLER_FORMATTER]);
         }
         $Logger->pushHandler($AbstractHandler);
     }
 }
开发者ID:amberovsky,项目名称:zf2-monolog,代码行数:25,代码来源:MonologFactory.php

示例5: testGetName

 /**
  * @covers Monolog\Logger::getName
  */
 public function testGetName()
 {
     $logger = new Logger('foo');
     $this->assertEquals('foo', $logger->getName());
 }
开发者ID:saj696,项目名称:pipe,代码行数:8,代码来源:LoggerTest.php

示例6: getName

 /**
  * 
  *
  * @return string 
  * @static 
  */
 public static function getName()
 {
     return \Monolog\Logger::getName();
 }
开发者ID:samcrosoft,项目名称:MicroTranslate,代码行数:10,代码来源:lumen_ide_helper.php

示例7: Logger

#!/usr/bin/env php
<?php 
// Bring in the dependencies
require_once __DIR__ . "/vendor/autoload.php";
use Monolog\Logger;
use LeeSherwood\Ejabberd\AuthenticationService;
use LeeSherwood\Ejabberd\CommandExecutors\DummyCommandExecutor;
// Setup Logger
$logger = new Logger('ejabberdAuth');
// Create the log handler(s) (lower the logging level for more verbosity)
$syslogHandler = new Monolog\Handler\SyslogHandler($logger->getName(), LOG_SYSLOG, Logger::DEBUG);
// Attach the handler
$logger->pushHandler($syslogHandler);
// Setup command executor
$executor = new DummyCommandExecutor();
// Boot the service
$application = new AuthenticationService($logger, $executor);
// Execute the run loop
$application->run();
开发者ID:leesherwood,项目名称:ejabberd-php-auth,代码行数:19,代码来源:EjabberdAuthenticationApplication.php

示例8: getName

 /**
  * @return string
  */
 public function getName()
 {
     return parent::getName();
 }
开发者ID:akentner,项目名称:incoming-ftp,代码行数:7,代码来源:LoggerProxy.php

示例9: clear

 /**
  * @param Logger $logger
  */
 public function clear(Logger $logger)
 {
     $this->db->exec(sprintf('DELETE FROM `%s` WHERE `channel` = ?', $this->table), [$logger->getName()]);
 }
开发者ID:starweb,项目名称:starlit-db,代码行数:7,代码来源:DbHandler.php

示例10: getChannelName

 /**
  * Get the current channel name
  *
  * @return string
  */
 public function getChannelName()
 {
     return $this->channel->getName();
 }
开发者ID:ellipsesynergie,项目名称:backend-skeleton,代码行数:9,代码来源:MonologLogger.php


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