Skip to content

Commit 8eaf4f2

Browse files
committed
removed FireLogger (BC break)
1 parent 814ab16 commit 8eaf4f2

9 files changed

+3
-410
lines changed

examples/firelogger.php

-45
This file was deleted.

readme.md

-29
Original file line numberDiff line numberDiff line change
@@ -343,35 +343,6 @@ echo Debugger::timer(); // elapsed time in seconds
343343
```
344344

345345

346-
FireLogger
347-
----------
348-
349-
You cannot always send debugging information to the browser window. This applies to AJAX requests or generating XML files to output. In such cases, you can send the messages by a separate channel into FireLogger. Error, Notice and Warning levels are sent to FireLogger window automatically. It is also possible to log suppressed exceptions in running application when attention to them is important.
350-
351-
How to do it?
352-
353-
- install extension [FireLogger for Chrome](https://chrome.google.com/webstore/detail/firelogger-for-chrome/hmagilfopmdjkeomnjpchokglfdfjfeh)
354-
- turn on Chrome DevTools (using Ctrl-Shift-I key) and open Console
355-
356-
Navigate to the [demo page](https://examples.nette.org/tracy/) and you will see messages sent from PHP.
357-
358-
Because Tracy\Debugger communicates with FireLogger via HTTP headers, you must call the logging function before the PHP script sends anything to output. It is also possible to enable output buffering and delay the output.
359-
360-
```php
361-
use Tracy\Debugger;
362-
363-
Debugger::fireLog('Hello World'); // send string into FireLogger console
364-
365-
Debugger::fireLog($_SERVER); // or even arrays and objects
366-
367-
Debugger::fireLog(new Exception('Test Exception')); // or exceptions
368-
```
369-
370-
The result looks like this:
371-
372-
![FireLogger](https://nette.github.io/tracy/images/tracy-firelogger.png)
373-
374-
375346
Custom Logger
376347
-------------
377348

src/Tracy/Debugger/Debugger.php

+1-30
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ class Debugger
3939
/** @var bool whether to display debug bar in development mode */
4040
public static $showBar = true;
4141

42-
/** @var bool whether to send data to FireLogger in development mode */
43-
public static $showFireLogger = true;
44-
4542
/** @var int size of reserved memory */
4643
public static $reservedMemorySize = 500000;
4744

@@ -102,7 +99,7 @@ class Debugger
10299
/** @var string|array email(s) to which send error notifications */
103100
public static $email;
104101

105-
/** for Debugger::log() and Debugger::fireLog() */
102+
/** for Debugger::log() */
106103
public const
107104
DEBUG = ILogger::DEBUG,
108105
INFO = ILogger::INFO,
@@ -151,9 +148,6 @@ class Debugger
151148
/** @var ILogger */
152149
private static $logger;
153150

154-
/** @var ILogger */
155-
private static $fireLogger;
156-
157151
/** @var array{DevelopmentStrategy, ProductionStrategy} */
158152
private static $strategy;
159153

@@ -242,7 +236,6 @@ public static function enable($mode = null, ?string $logDirectory = null, $email
242236
'Dumper/Exposer',
243237
'Dumper/Renderer',
244238
'Dumper/Value',
245-
'Logger/FireLogger',
246239
'Logger/Logger',
247240
'Session/SessionStorage',
248241
'Session/FileSession',
@@ -442,16 +435,6 @@ public static function getLogger(): ILogger
442435
}
443436

444437

445-
public static function getFireLogger(): ILogger
446-
{
447-
if (!self::$fireLogger) {
448-
self::$fireLogger = new FireLogger;
449-
}
450-
451-
return self::$fireLogger;
452-
}
453-
454-
455438
/** @return ProductionStrategy|DevelopmentStrategy @internal */
456439
public static function getStrategy()
457440
{
@@ -584,18 +567,6 @@ public static function log($message, string $level = ILogger::INFO)
584567
}
585568

586569

587-
/**
588-
* Sends message to FireLogger console.
589-
* @param mixed $message
590-
*/
591-
public static function fireLog($message): bool
592-
{
593-
return !self::$productionMode && self::$showFireLogger
594-
? self::getFireLogger()->log($message)
595-
: false;
596-
}
597-
598-
599570
/** @internal */
600571
public static function addSourceMapper(callable $mapper): void
601572
{

src/Tracy/Debugger/DevelopmentStrategy.php

+2-6
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public function handleException(\Throwable $exception, bool $firstTime): void
4949
$this->blueScreen->render($exception);
5050

5151
} else {
52-
Debugger::fireLog($exception);
5352
$this->renderExceptionCli($exception);
5453
}
5554
}
@@ -103,11 +102,8 @@ public function handleError(
103102
$message = 'PHP ' . Helpers::errorTypeToString($severity) . ': ' . Helpers::improveError($message);
104103
$count = &$this->bar->getPanel('Tracy:errors')->data["$file|$line|$message"];
105104

106-
if (!$count++) { // not repeated error
107-
Debugger::fireLog(new ErrorException($message, 0, $severity, $file, $line));
108-
if (!Helpers::isHtmlMode() && !Helpers::isAjax()) {
109-
echo "\n$message in $file on line $line\n";
110-
}
105+
if (!$count++ && !Helpers::isHtmlMode() && !Helpers::isAjax()) {
106+
echo "\n$message in $file on line $line\n";
111107
}
112108

113109
if (function_exists('ini_set')) {

src/Tracy/Logger/FireLogger.php

-187
This file was deleted.

src/tracy.php

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
require __DIR__ . '/Tracy/Dumper/Exposer.php';
1919
require __DIR__ . '/Tracy/Dumper/Renderer.php';
2020
require __DIR__ . '/Tracy/Logger/ILogger.php';
21-
require __DIR__ . '/Tracy/Logger/FireLogger.php';
2221
require __DIR__ . '/Tracy/Logger/Logger.php';
2322
require __DIR__ . '/Tracy/Debugger/Debugger.php';
2423
require __DIR__ . '/Tracy/Debugger/DeferredContent.php';

0 commit comments

Comments
 (0)