Skip to content

Commit

Permalink
fix for latest Tracy 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Mar 14, 2024
1 parent 160feb9 commit 76f725f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"require": {
"php": ">=7.2",
"tracy/tracy": "~2.4",
"tracy/tracy": "~2.10",
"monolog/monolog": "~2.0"
},
"require-dev": {
Expand Down
8 changes: 4 additions & 4 deletions src/Bridges/NetteDI/MonologExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ public function loadConfiguration(): void

} else {
$builder->addDefinition($this->prefix('handler'))
->setClass(RotatingFileHandler::class)
->setType(RotatingFileHandler::class)
->setArguments([$logDir . '/nette.log'])
->setAutowired(false);

$builder->addDefinition($this->prefix('tracyExceptionProcessor'))
->setClass(TracyExceptionProcessor::class)
->setType(TracyExceptionProcessor::class)
->setArguments([$logDir, '@Tracy\BlueScreen'])
->setAutowired(false);

$monologLogger = $builder->addDefinition($this->prefix('monologLogger'))
->setClass(MonologLogger::class)
->setType(MonologLogger::class)
->setArguments(['nette'])
->addSetup('pushHandler', ['@' . $this->prefix('handler')])
->addSetup('pushProcessor', ['@' . $this->prefix('tracyExceptionProcessor')])
->setAutowired(false);
}

$builder->addDefinition($this->prefix('tracyLogger'))
->setClass(Logger::class)
->setType(Logger::class)
->setArguments([$monologLogger]);

if ($builder->hasDefinition('tracy.logger')) {
Expand Down
2 changes: 1 addition & 1 deletion src/Processors/TracyExceptionProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected static function formatMessage(Throwable $message): string
while ($message) {
$tmp[] = ($message instanceof \ErrorException
? Helpers::errorTypeToString($message->getSeverity()) . ': ' . $message->getMessage()
: Helpers::getClass($message) . ': ' . $message->getMessage()
: get_class($message) . ': ' . $message->getMessage()
) . ' in ' . $message->getFile() . ':' . $message->getLine();
$message = $message->getPrevious();
}
Expand Down

0 comments on commit 76f725f

Please sign in to comment.