The t3lib_div:devlog() function is defined as follows:
/**
* Developer log; This should be implemented around the source code, both frontend and backend, logging everything from the flow through an application, messages, results from comparisons to fatal errors.
* The result is meant to make sense to developers during development or debugging of a site.
* The idea is that this function is only a wrapper for external extensions which can set a hook which will be allowed to handle the logging of the information to any format they might wish and with any kind of filter they would like.
* If you want to implement the devLog in your applications, simply add lines like:
* if (TYPO3_DLOG) t3lib_div::devLog('[write message in english here]', 'extension key');
*
* @param string Message (in english).
* @param string Extension key (from which extension you are calling the log)
* @param integer Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message
* @param array Additional data you want to pass to the logger.
* @return void
*/
function devLog($msg, $extKey, $severity=0, $dataVar=FALSE) {
I suggest to use the t3lib_div:devlog() function like this:
class t3lib_userAuth {
// write messages into the devlog?
var $writeDevLog = FALSE;
function start() {
global $TYPO3_CONF_VARS;
// enable dev logging if set
if ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['writeDevLog'])
$this->writeDevLog = TRUE;
if (TYPO3_DLOG) $this->writeDevLog = TRUE;
...
if ($this->writeDevLog AND !is_array($this->user)) t3lib_div::devLog('No user session found.', 't3lib_userAuth', 2);