nette / tracy

😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.
https://tracy.nette.org
Other
1.76k stars 218 forks source link

PSR adapters: swap names #564

Closed dakur closed 1 year ago

dakur commented 1 year ago

I've got confused a lot about the names of adapters to/from PSR. When I read PsrToTracyLoggerAdapter, I would definitely expect that such adapter implements PSR interface and forward passed error/log to tracy logger. But it does the opposite! That's super confusing from developer's point of view.

Can it be changed please?

dg commented 1 year ago

No :-)

JanTvrdik commented 1 year ago

Unfortunately the name make sense both ways. It's a known issue.

PsrToTracyLoggerAdapter converts "PSR logger" to "Tracy logger". So if you have a PSR logger and want to have Tracy logger, this is the adapter you would use.

dakur commented 1 year ago

Thanks for elaboration. I still don't really see it but maybe it's because I didn't encounter it from the other side.

MartinMystikJonas commented 1 year ago

It is question if you look at direction of data flow (convert Tracy log to PSR log) or direction of type change by adapter (adapt PSR logger to Tracy logger). For Adapter later makes more sense IMHO.