html5-php icon indicating copy to clipboard operation
html5-php copied to clipboard

Expose debug mode and use PSR logger

Open mattfarina opened this issue 10 years ago • 6 comments

In a few places there is a debug mode that prints to standard out. We can expose this in the Html5 and use the PSR logger interface (still printing to standard out by default).

mattfarina avatar Jun 22 '15 13:06 mattfarina

yay! :+1: nice ti have in 3.0!

goetas avatar Jun 22 '15 13:06 goetas

I think adding support for a PSR logger could even be done in 2.x in a BC way

stof avatar Mar 19 '19 09:03 stof

hmm, can you explain your idea?

goetas avatar Mar 19 '19 09:03 goetas

Well, you could add support for injecting a logger (which would be optional):

  • logger injected -> log stuff at debug level in the logger
  • no logger injected and debug mode turned on -> write to stdout (and report that as deprecated during initialization ?)
  • no logger injected and debug mode turned off -> no debug info

The remaining question is whether the logging itself should be subject to the debug mode or no. I don't think it is needed: injecting the logger would be optional, and then most logging library also provide a way to ignore log messages below a given level.

stof avatar Mar 19 '19 11:03 stof

hmm, it looks like the only usage of the debug mode is to dump the input string at the beginning of the processing. So maybe it is not even useful.

stof avatar Mar 19 '19 11:03 stof

Also to me looks non that useful.

From what I can guess. Was used at the very beginning of the library, just for debug purposes

goetas avatar Mar 19 '19 17:03 goetas