Log Debbuger log message to tracy bar

Fires
Member | 97
+
0
-

Hello is possible to send the custom error message to tracy bar? Same as E_NOTIFICATION error (just the alert icon) for example for not implemented functions Debugger::log(“not implemented”, Debugger::ERROR);

Thanks

Marek Bartoš
Nette Blogger | 1273
+
+2
-

To display logs in Tracy bar, you have to:

  • create a Tracy\ILogger implementation that has a method to get logs
    • and set is as a logger used by the Debugger
    • (also a wrapper for multiple loggers, if you want to keep the original logger working)
  • create a Tracy\IBarPanel implementation that will get logs from the logger and render them
    • and add that panel to the bar

Or just use my Monolog integration that already has that functionality – orisai/nette-monolog

  • and active the bridge for logging from Tracy
  • and the bridge for Tracy bar panel

Last edited by Marek Bartoš (2024-08-13 19:52)