DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
CCDevlog¶
Author: | Kasper Skårhøj |
---|---|
Created: | 2002-11-01T00:32:00 |
Changed: | 2005-01-01T19:46:13 |
Author: | René Fritz |
Email: | r.fritz@colorcube.de |
Info 3: | |
Info 4: |
CCDevlog¶
Extension Key: cc_devlog
Copyright 2004-2005, René Fritz, <r.fritz@colorcube.de>
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
- a GNU/GPL CMS/Framework available from www.typo3.com
Introduction¶
“ 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 CCDevlog extension provides development logging/debugging
functionality for the usage of t3lib\_div::devlog()
. The
t3lib\_div::devlog()
function itself provides only an
interface for logging but no implementation.
CCDevlog logs messages from t3lib\_div::devlog()
calls into a
database table. The log entries can be viewed with a backend module.
The module can be opened in an separate window.
Features:
- log entries are logged in log sessions – one log session per script run. That makes it easy to separate log runs.
- frontend logging include the page id
- Auto refresh
- Show log runs or latest entries
- Clicking on log entry show the corresponding log run only
Users manual¶
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);