Comments (7)
I have this problem as well, using Contributte/Logging. Obviously this code Tracy\Debugger::getLogger()->mailer = ?;
should not rely on the property to maybe exist, rather there should be something like MailLogger interface having the setMailer function.
Adding @ to suppress the deprecation provides a quick fix.
from tracy.
In this case best solution would probably be to throw an exception in case logger is not instance of Tracy\Logger
. You are using different ILogger
implementation that does not support sending emails.
from tracy.
@radimvaculik I fixed the issue in orisai/nette-monolog. You should be fine if you copy LazyTracyToPsrLogger changes to your SentryDecoratedTracyLogger orisai/nette-monolog@6f39f96#diff-34f516dc85e79726f910d1b0e989ea939cbf310611cf0507e69eee3b4a12a127R56-R110
from tracy.
Do you override the logger yourself? Or is it overriden by some logging extension?
I think I already solved that issue in both orisai/nette-monolog and contributte/monolog by preserving original logger (in case Tracy bridge is enabled)
from tracy.
@mabar I use final class SentryDecoratedTracyLogger implements ILogger
and use $this->parentLogger = Debugger::getLogger();
to preserve Tracy logging.
from tracy.
Oh, my solution is currently broken too.
It overrides logger returned by Debugger::getLogger()
and disables autowiring for service tracy.logger
so my ILogger
implementation is autowired instead even if service tracy.logger
is created before Monolog has chance to wire into Tracy.
But. Order matters. If Monolog extension is loaded first, Tracy sets options to incorrect logger.
My case would be fixed by replacing Tracy\Debugger::getLogger()->mailer =
by $this->getService('tracy.logger')->mailer =
in generated DIC
from tracy.
I have the very same problem in a custom implementation of Tracy\ILogger
.
My current solution is to place a public $mailer
property on my implementation and ignore it's value.
And I 100% agree that Tracy\ILogger
does not support email and should not be treated as Tracy\Logger
(or anything) which supports email. If a mailer is to be set, you better make sure that you're dealing with Tracy\Logger
before you start accessing properties that cannot possibly ever exist on the interface (in fact, on any interface).
Adding magic methods to my implementation is a no go,
Adding a setMailer() method to the interface (or an extended interface) seems viable even if it would be BC. I mean, unless the motto is "If it's broken and we cannot fix it without introducing a BC, we'd rather not fix it at all"....
from tracy.
Related Issues (20)
- CSS styles in Tracy HOT 1
- Can no longer set maxAjaxRows or panelZIndex HOT 6
- White Screen after upgrade HOT 3
- Huge amount of tracy sessions files "tracy-*" HOT 1
- Error line is not highlighted on CLI mode HOT 5
- `Content-Length` warning is reported even when sending `FileResponse` HOT 1
- Compatibility with Latte 3
- Tracy causes scrollbars after the update HOT 2
- Body flex based design is overridden by bluescreen style
- 2 additional lines for VSCodium in open-editor.sh
- After expand services in DI panel opened in new window there is nothing rendered HOT 5
- Default setting log directory /log not works as written in documentation HOT 4
- Contents of DateTime is not dumped HOT 1
- TypeError: Tracy\Dumper\Describer::addPropertyTo(): Argument #2 ($k) must be of type string, int given HOT 4
- `Exposer` purges content of some implementations of `Ds\Collection` HOT 4
- Tracy distributed in phar file doesn't work on PHP7 from version 2.9.5 HOT 1
- PSR adapters: swap names HOT 4
- PHP 8.2: ErrorException::$skippable is deprecated HOT 2
- Tracy\Helpers::editorUri() is_file() error with Latte StringLoader and open_basedir
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tracy.