本文整理汇总了PHP中Tracy\Debugger::getLogger方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::getLogger方法的具体用法?PHP Debugger::getLogger怎么用?PHP Debugger::getLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracy\Debugger
的用法示例。
在下文中一共展示了Debugger::getLogger方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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();
}
示例3: register
/**
* @param Container $app
*
* @return mixed
*
* @throws DependencyInstanceNotFound
*/
public function register(Container $app)
{
/** @var Application $app */
$config = $this->config;
// this service provider will quietly fail if Tracy is not installed.
if (class_exists('\\Tracy\\Debugger') and $config->get('logging.tracy.enabled')) {
// use the environment to configure the Debugger
$env = env('APP_ENV') === 'PRODUCTION' ? Debugger::PRODUCTION : Debugger::DEVELOPMENT;
Debugger::$maxDepth = $config->get('logging.tracy.maxDepth', 6);
Debugger::enable($env, rtrim($config->get('logging.logPath', LOGS), '/'));
Debugger::$showLocation = env('DEBUG') and $config->get('logging.tracy.showLocation', FALSE);
Debugger::$strictMode = $config->get('logging.tracy.strictMode', FALSE);
Debugger::$showBar = FALSE;
# env('DEBUG');
// use the Tracy Debugger for logging.
$app['tracy'] = Debugger::getLogger();
$app['nine.logger'] = function ($app) {
return $app['tracy'];
};
}
}
示例4: 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;
}
}
示例5: elapsed_time_since_request
<?php
/**
* @package Og
* @version 0.1.0
* @author Greg Truesdell <odd.greg@gmail.com>
*/
use Og\Forge;
use Og\Support\Util;
use Tracy\Debugger;
use Tracy\FireLogger;
Debugger::$maxDepth = 6;
Debugger::enable(Debugger::DEVELOPMENT, LOCAL_LOGS);
Debugger::$showLocation = TRUE;
$logger = Debugger::getLogger();
Forge::getInstance()->instance(['logger', FireLogger::class], $logger);
/**
* @param bool $raw
*
* @return string
*/
function elapsed_time_since_request($raw = FALSE)
{
return !$raw ? sprintf("%8.1f ms", (microtime(TRUE) - $_SERVER['REQUEST_TIME_FLOAT']) * 1000) : (microtime(TRUE) - $_SERVER['REQUEST_TIME_FLOAT']) * 1000;
}
/**
* @param $index
*
* @return string
*/
function location_from_backtrace($index = 2)
示例6: __construct
/**
* @param array $logLevels
*/
public function __construct(array $logLevels)
{
$this->oldLogger = \Tracy\Debugger::getLogger();
$this->logLevels = $logLevels;
}
示例7: Configurator
<?php
use Arachne\Bootstrap\Configurator;
use Tracy\Debugger;
// Load autoloader generated by Composer
require __DIR__ . '/../vendor/autoload.php';
// Normalized internal encoding
mb_internal_encoding('UTF-8');
// Normalized locale settings
$locale = 'en_US.UTF-8';
setlocale(LC_ALL, $locale);
putenv('LC_ALL=' . $locale);
$configurator = new Configurator();
$configurator->addParameters(['appDir' => __DIR__, 'wwwDir' => __DIR__ . '/../www']);
$configurator->enableDebugger(__DIR__ . '/../log', 'enumag@gmail.com');
Debugger::getLogger()->emailSnooze = '1 hour';
// Specify folder for cache
$configurator->setTempDirectory(__DIR__ . '/../temp');
// Create Dependency Injection container from config.neon file
$configurator->addConfig(__DIR__ . '/config/config.neon', false);
return $configurator->createContainer();
示例8: function
});
Container::extensionMethod('addDateTimePicker', function (Container $container, $name, $label = NULL) {
return $container[$name] = new Controls\DateTimePicker($label);
});
Container::extensionMethod('addTypeahead', function (Container $container, $name, $label = NULL, $callback = NULL) {
return $container[$name] = new Controls\Typeahead($label, $callback);
});
$configurator = new Nette\Configurator();
if (DEV_MODE === TRUE) {
$configurator->setDebugMode(TRUE);
} elseif (isset($debugIPs)) {
$configurator->setDebugMode($debugIPs);
}
$configurator->enableDebugger(DIR_ROOT . '/log', isset($debugMail) ? $debugMail : NULL);
$configurator->setTempDirectory(DIR_ROOT . '/temp');
if (!isset($robotLoaderDirs)) {
$robotLoaderDirs = [];
}
$robotLoaderDirs[] = DIR_VENDOR . '/cothema/';
$robotLoaderDirs[] = DIR_ROOT . '/app/';
$robotLoader = $configurator->createRobotLoader();
foreach ($robotLoaderDirs as $robotLoaderDirsOne) {
$robotLoader->addDirectory($robotLoaderDirsOne);
}
$robotLoader->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
is_file(DIR_ROOT . '/app/config/config.neon') && $configurator->addConfig(DIR_ROOT . '/app/config/config.neon');
$configurator->addConfig(DIR_ROOT . '/app/config/config.local.neon');
$container = $configurator->createContainer();
\Tracy\Debugger::getLogger()->emailSnooze = isset($debugMailSnooze) ? $debugMailSnooze : '30 minutes';
return $container;
示例9: log
public function log($level, $msg)
{
Debugger::getLogger()->log($msg, self::LEVEL);
}