[TYPO3-v4] Harmonizing severity levels

François Suter fsu-lists at cobweb.ch
Fri Nov 5 15:09:54 CET 2010


Hi,

(answering to Steffen too)

>> I'd like to have common levels as in Log4j:

Steffen also mentioned syslogd, which has the following levels:

KERN_EMERG    "<0>"  /* system is unusable               */
KERN_ALERT    "<1>"  /* action must be taken immediately */
KERN_CRIT     "<2>"  /* critical conditions              */
KERN_ERR      "<3>"  /* error conditions                 */
KERN_WARNING  "<4>"  /* warning conditions               */
KERN_NOTICE   "<5>"  /* normal but significant condition */
KERN_INFO     "<6>"  /* informational                    */
KERN_DEBUG    "<7>"  /* debug-level messages             */

(from: http://linux.about.com/library/cmd/blcmdl2_syslog.htm)

Note that all these systems don't have an "OK" level. Of course you 
could say that printing information about successes can be categorize as 
debugging information, but I think it's good to have a level for this, 
so that it clearly shows that an "OK" message means that something has 
happened according to expectations.

> Just to say, in conjunction with what Steffen wrote, is that this list
> is logical because each level means less/more messages than previous one
> (TRACE is huge list, DEBUG a bit less, INFO still less, ...) whereas
> what we have with -1 = "OK" and 0 = "debug" and then info, it's not
> logical.

I see your point. Indeed the levels of the FlashMessages are even less 
consistent. It's a shame we didn't take a close look when that feature 
was introduced. I wonder where they come from.

I can see that the FlashMessages levels would be even worse, especially 
in the light of introducing a feature where you can filter according to 
a given level or more. For such a case you need a real progression.

However when I look at the list of levels from Log4j or syslogd I feel 
like there are too many levels. It can become very hard to decide which 
level should be used for any given message.

> And I'd like to have a "TRACE" mode because it could be useful when
> debugging some complicated extensions and not being forced to comment
> out/remove all those statements when releasing it.

This actually exemplifies what I mentioned above. I generally use "info" 
for that. Is that not good for you? If not, then what do you use "info" 
for? Just curious, we all have our habits.

I know that there have already been talks about this, which led nowhere, 
especially because of the complexity of fixing the core. And "devlog" 
cannot function by ignoring the core, as it is just a utility called by 
t3lib_div::devLog(), i.e. the core itself. What's more fixing the core 
is not just about FlashMessages, but also about sysLog, which uses yet 
other levels.

The problem is not really about redefining levels, but about the 
consequences of such change: changing the core is one thing, but there 
are also lots of extensions out there which could be broken by such a 
change. Maybe one way is to introduce new logging functions. The old 
ones would be marked as deprecated and perform the mapping between old 
severity levels and new ones.

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-project-v4 mailing list