I've had to use today the logging framework and I have some remarks which made its configuration a bit tricky, for me :
Defaut log level is said to be at Pluf_Log::INFO level in http://pluf.org/doc/logging.html#link4
However, if I do not miss anything, the default log level is set not to log anything :
http://projects.ceondo.com/p/pluf/source/tree/master/src/Pluf/Log.php#L95
Second, the log_level configuration var is mentioned, but I failed using it and could not find it used anywhere in the souce code.
I understand that because it is kind of a static class and there is no real construction of an instance, thus we cannot initialize the class to the config log level.
So I add a line in the config file :
Pluf_Log::$level = Pluf_Log::ALL;
If it is the preferred method, maybe it could be useful to update the doc to clarify this.
--
Baptiste
This is effectively the prefered method at the moment. In fact, if you
have an idea on a better way to go, I would be pleased to hear about it.
I have the same problem with Photon, I am also using the singleton
pattern with a static value to set the log level, but I don't know how
we could do it fast and elegantly if we had to set the value in the conf
with something like:
$cfg['log_level'] = Pluf_Log::ALL;
Should we have something like a "configure" event where each registered
component could listen and configure themselves?
Feedback *very* welcomed,
lo�c