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


PHP Debugger::setLogger方法代码示例

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


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

示例1: onStartup

 public function onStartup(Application $app)
 {
     if (!extension_loaded('newrelic')) {
         return;
     }
     $oldLogger = Debugger::getLogger();
     $logger = new Logger($oldLogger->directory, $oldLogger->email);
     $logger->emailSnooze = $oldLogger->emailSnooze;
     $logger->mailer = $oldLogger->mailer;
     Debugger::setLogger($logger);
 }
开发者ID:enumag,项目名称:newrelic-nette-1,代码行数:11,代码来源:NewRelicProfilingListener.php

示例2: 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

示例3: register

 /**
  * Register logger to \Tracy\Debugger
  * @param array $config
  */
 public static function register($config)
 {
     if ($config['send_errors']) {
         unset($config['send_errors']);
         $logger = new self(TDebugger::$logDirectory);
         $logger->email =& TDebugger::$email;
         TDebugger::setLogger($logger);
         \Errbit::instance()->configure($config);
         //                ->start();
     }
 }
开发者ID:tomaj,项目名称:nette-errbit,代码行数:15,代码来源:ErrbitLogger.php

示例4: init

 /**
  * @param string[]|array|NULL $logLevel (null for default - error and critical)
  * @param string|NULL $appName
  * @param string|NULL $license
  */
 public static function init(array $logLevel = NULL, $appName = NULL, $license = NULL)
 {
     static::check();
     if (!static::isEnabled()) {
         return;
     }
     if ($appName === NULL) {
         $appName = 'PHP Application';
     }
     static::setup($appName, $license);
     if ($logLevel === NULL) {
         $logLevel = [\Tracy\Logger::CRITICAL, \Tracy\Logger::EXCEPTION, \Tracy\Logger::ERROR];
     }
     $logger = new Logger($logLevel);
     \Tracy\Debugger::setLogger($logger);
 }
开发者ID:vrtak-cz,项目名称:newrelic-tracy,代码行数:21,代码来源:Bootstrap.php

示例5: onStartup

 /**
  * @param Nette\Application\Application $app
  */
 public function onStartup(Nette\Application\Application $app)
 {
     Consumerr::setUrl(Tracy\Debugger::$source);
     Consumerr::addExtension(NetteConsumerr::EXTENSION_NAME, NetteConsumerr::VERSION_CODE);
     if (class_exists('Nette\\Framework')) {
         Consumerr::addLibrary('nette-framework', Nette\Framework::VERSION_ID);
     }
     if (class_exists('Tracy\\Debugger') && property_exists('Tracy\\Debugger', 'version')) {
         $version = str_replace('-dev', ".99", Tracy\Debugger::$version);
         $version = explode(".", $version);
         Consumerr::addLibrary('tracy', $version[0] * 10000 + $version[1] * 100 + $version[2]);
     }
     $logger = $this->createLogger();
     if (method_exists('Tracy\\Debugger', 'getLogger')) {
         Tracy\Debugger::setLogger($logger);
         Tracy\Debugger::getLogger()->directory =& Tracy\Debugger::$logDirectory;
         Tracy\Debugger::getLogger()->email =& Tracy\Debugger::$email;
     } else {
         Tracy\Debugger::$logger = $logger;
         Tracy\Debugger::$logger->directory =& Tracy\Debugger::$logDirectory;
         Tracy\Debugger::$logger->email =& Tracy\Debugger::$email;
     }
 }
开发者ID:consumerr,项目名称:nette,代码行数:26,代码来源:NetteConsumerr.php

示例6: initialize

 public function initialize()
 {
     date_default_timezone_set('Europe/Prague');
     Nette\Bridges\Framework\TracyBridge::initialize();
     $this->getService('events.manager')->createEvent(array('Nette\\DI\\Container', 'onInitialize'))->dispatch($this);
     Tracy\Debugger::$email = 'michal.fuca.fucik@gmail.com';
     Tracy\Debugger::$editor = 'sublime';
     Tracy\Debugger::$browser = 'chromium-browser';
     Tracy\Debugger::$strictMode = TRUE;
     Nette\Caching\Storages\FileStorage::$useDirectories = TRUE;
     $this->getByType("Nette\\Http\\Session")->exists() && $this->getByType("Nette\\Http\\Session")->start();
     header('X-Frame-Options: SAMEORIGIN');
     $this->getService('systemModule.initializer');
     $this->getService('usersModule.initializer');
     $this->getService('securityModule.initializer');
     header('X-Powered-By: Nette Framework');
     header('Content-Type: text/html; charset=utf-8');
     Nette\Utils\SafeStream::register();
     Nette\Reflection\AnnotationsParser::setCacheStorage($this->getByType("Nette\\Caching\\IStorage"));
     Nette\Reflection\AnnotationsParser::$autoRefresh = FALSE;
     Doctrine\Common\Annotations\AnnotationRegistry::registerLoader("class_exists");
     Kdyby\Doctrine\Diagnostics\Panel::registerBluescreen($this);
     Kdyby\Doctrine\Proxy\ProxyAutoloader::create('/home/fuca/Projects/www/sportsclub/tests/tmp/proxies', 'Kdyby\\GeneratedProxy')->register();
     Nette\Diagnostics\Debugger::getBlueScreen()->collapsePaths[] = '/home/fuca/Projects/www/sportsclub/vendor/kdyby/doctrine/src/Kdyby/Doctrine';
     Nette\Diagnostics\Debugger::getBlueScreen()->collapsePaths[] = '/home/fuca/Projects/www/sportsclub/vendor/doctrine';
     Nette\Diagnostics\Debugger::getBlueScreen()->collapsePaths[] = '/home/fuca/Projects/www/sportsclub/tests/tmp/proxies';
     Kdyby\Translation\Diagnostics\Panel::registerBluescreen();
     \Tracy\Debugger::setLogger($this->getService('monolog.adapter'));
 }
开发者ID:fuca,项目名称:sportsclub,代码行数:29,代码来源:4f37a2599b20523b09d6c7f79d6941d4.php

示例7:

<?php

require __DIR__ . '/../vendor/autoload.php';
$configurator = new Nette\Configurator();
$configurator->setTempDirectory(getenv("MONDA_TMP"));
$configurator->createRobotLoader()->addDirectory(__DIR__)->addDirectory(__DIR__ . '/../vendor/others')->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();
use Tracy\Debugger;
if (!getenv("MONDA_CLI")) {
    Debugger::enable(array('127.0.0.1'), __DIR__ . "/../log/");
} else {
    Debugger::enable(Debugger::DETECT, __DIR__ . "/../log/");
    Debugger::$productionMode = false;
    Debugger::setLogger(new \App\Model\CliLogger());
}
return $container;
开发者ID:jiang51,项目名称:monda,代码行数:17,代码来源:bootstrap.php

示例8: __construct

 /**
  * SentryLogger constructor.
  * @param $dsn
  * @param bool $inDebug
  * @param null $directory
  * @param null $email
  * @param bool $autoWire
  * @param array $options
  */
 public function __construct($dsn, $inDebug = false, $directory = null, $email = null, $autoWire = true, $options = [])
 {
     // Compability with nette 2.2.0, Tracy\Logger has no __construct in 2.2.0
     if ((new \ReflectionClass('Tracy\\Logger'))->getConstructor()) {
         parent::__construct($directory, $email, Debugger::getBlueScreen());
     }
     //Check for production mode, you will want to fllod sentry only in production... right ?
     $this->enabled = Debugger::$productionMode || $inDebug;
     $this->raven = new \Raven_Client($dsn, $options);
     if ($autoWire) {
         //Add sentryNetteLogger to tracy
         $that = $this;
         Debugger::$onFatalError[] = function ($e) use($that) {
             $that->onFatalError($e);
         };
         // Add logger to tracy
         Debugger::setLogger($this);
     }
 }
开发者ID:salamek,项目名称:raven-nette,代码行数:28,代码来源:SentryLogger.php


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