html5-php
html5-php copied to clipboard
Expose debug mode and use PSR logger
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).
yay! :+1: nice ti have in 3.0!
I think adding support for a PSR logger could even be done in 2.x in a BC way
hmm, can you explain your idea?
Well, you could add support for injecting a logger (which would be optional):
- logger injected -> log stuff at
debuglevel 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.
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.
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