[TYPO3-dev] t3lib_tcemain::log() question

Francois Suter fsuter at cobweb.ch
Tue Jul 1 16:34:39 CEST 2008


Hi all,

I am playing around with TCEmain at the moment. Many messages get 
written using the log() method. All these messages are stored in the 
sys_log. Errors (messages with error status > 0) are also stored in an 
internal array called $this->errorLog.

I wanted to use this array to write errors to the devlog so that I could 
check all errors in one place and not switch between devlog and sys_log. 
The messages as stored in $this->errorLog are not very helpful. Messages 
are comprised of a string (paremeter $details in the log() call) which 
may contain %s markers. Another parameter ($data) may be an array whose 
data can be taken to replace the %s markers. But this substitution is 
not done in the log() method. Neither is it done in the sys_log. It is 
only done when the sys_log is displayed in the Log BE module.

This means that the message stored in $this->errorLog is rather useless. 
It looks like:

[1.1.12]: SQL error: '%s' (%s)

whereas the sys_log in the Log module looks like:

Attempt to insert a record on page 'Duplicate entry '408143' for key 2' 
(tx_whfdb_individual_associates:NEW_5) from table '' without 
permissions. Or non-existing page. (msg#1.1.12)

Slightly more informative, isn't it?

So the question is: what is $this->errorLog for? For sure it can be used 
just to do count($this->errorLog) to see if any error happened, but it 
is not informative enough to be useful. Is it useless then or would it 
be worth patching the log() method to store better messages in 
$this->errorLog?

Cheers

-- 

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




More information about the TYPO3-dev mailing list