[TYPO3-core] RFC #9480: Bug/cleanup: Enhance debug information with SQL data

Francois Suter fsuter at cobweb.ch
Sat Oct 18 13:56:15 CEST 2008


Hi,

> better:
> create a "Null-Logger" class that is always present and only gets 
> replaced by other loggers like devlog.
> The Null-Logger would have the same interface as a real logger but does 
> just nothing else. No output, no logging, nothing.
> 
> This would save us the if() checks and we could just call the logger 
> whereever we want without worrying about whether there's a real logger 
> or not.

I'm not sure this is really necessary. t3lib_div::devLog() is already 
empty. It only calls a hook, so logging actually happens only if you 
have some extension installed that uses this hook. So there's already a 
mechanism similar to what you describe.

There is furthermore this TYPO3_DLOG constant, that says the following 
(in the Install Tool):

"Whether the developer log is enabled. See constant "TYPO3_DLOG""

This is not very explicit and could even be seen as redundant. If you 
have installed an extension that uses the t3lib_div::devLog() hook, it 
could mean that you actually *want* to log things and may not need to 
activate TYPO3 logging on top of it. On the other hand it gives a finer 
control which is quite useful in some cases.

The main point is that if the TYPO3_DLOG is to mean something then calls 
to t3lib_div::devLog() should be wrapped inside a test on this constant IMO.

> However, I'd suggest to do this in a separate patch.

Anyway ;-)

Cheers

-- 

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


More information about the TYPO3-team-core mailing list