| Advanced debug/log system.
More...
List of all members.
|
Public Methods |
| | eZDebug () |
| | messageName ($messageType) |
| & | instance () |
| | setHandleType ($type) |
| | errorHandler ($errno,$errstr,$errfile,$errline) |
| | setUseExternalCSS ($use) |
| | setMessageOutput ($output) |
| | addTimingPoint ($description="") |
| | write ($string,$verbosityLevel=EZ_LEVEL_NOTICE,$label="") |
| | isLogFileEnabled ($type) |
| | messageTypes () |
| & | logFiles () |
| | setScriptStart ($mtime=false) |
| | createAccumulatorGroup ($key,$name=false) |
| | createAccumulator ($key,$inGroup=false,$name=false) |
| | accumulatorStart ($key,$inGroup=false,$name=false) |
| | accumulatorStop ($key) |
Static Public Methods |
| | showMessage ($type) |
| | showTypes ($types=false) |
| | writeNotice ($string,$label="") |
| | writeWarning ($string,$label="") |
| | writeError ($string,$label="") |
| | writeDebug ($string,$label="") |
| | maxLogSize () |
| | setMaxLogSize ($size) |
| | maxLogrotateFiles () |
| | setLogrotateFiles ($files) |
| | rotateLog ($fileName) |
| | setLogFileEnabled ($enabled,$types=false) |
| | isDebugEnabled () |
| | updateSettings ($settings) |
| & | printReport ($newWindow=false,$as_html=true,$returnReport=false) |
Private Methods |
| | writeFile (&$logFileData,&$string,$verbosityLevel) |
| & | timeToFloat ($mtime) |
| & | printReportInternal ($as_html=true) |
Static Private Methods |
| & | dumpVariable ($var) |
Private Attributes |
| | DebugStrings = array() |
|
| TimePoints = array() |
| | Array which contains the time points.
|
|
| TmpTimePoints |
| | Array which contains the temporary time points.
|
|
| TimeAccumulatorList = array() |
| | Array wich contains time accumulators.
|
|
| ShowTypes |
| | Determines which debug messages should be shown.
|
|
| HandleType |
| | Determines what to do with php errors, ignore, fetch or output.
|
|
| OutputFormat |
| | An array of the outputformats for the different debug levels.
|
|
| LogFiles |
| | An array of logfiles used by the debug class with each key being the debug level.
|
|
| TimingAccuracy = 4 |
| | How many places behing . should be displayed when showing times.
|
|
| PercentAccuracy = 4 |
| | How many places behing . should be displayed when showing percentages.
|
|
| UseCSS |
| | Whether to use external CSS or output own CSS. True if external is to be used.
|
|
| MessageOutput |
| | Determines how messages are output (screen/log).
|
|
| MessageTypes |
| | A list of message types.
|
|
| LogFileEnabled |
| | A map with message types and whether they should do file logging.
|
|
| ScriptStart |
| | The time when the script was started.
|
|
| OverrideList |
| | A list of override directories.
|
Detailed Description
Advanced debug/log system.
The eZ debug library is used to handle debug information. It can display information on screen and/or write it to log files.
You can enable on-screen debug information for specific IP addresses.
Timing points can be placed in the code to time the different sections of code.
Each debug message can be turned on/off by using the showTypes() function.
PHP error messages can also be shown using setHandleType().
Definition at line ezdebug.php.
Constructor & Destructor Documentation
Member Function Documentation
| eZDebug::accumulatorStart |
( |
$ |
key, |
|
|
$ |
inGroup = false, |
|
|
$ |
name = false |
|
) |
|
|
| eZDebug::accumulatorStop |
( |
$ |
key |
) |
|
|
| eZDebug::addTimingPoint |
( |
$ |
description = "" |
) |
|
|
| eZDebug::createAccumulator |
( |
$ |
key, |
|
|
$ |
inGroup = false, |
|
|
$ |
name = false |
|
) |
|
|
|
|
Creates a new accumulator entry if one does not already exist and initializes with default data. If $name is not supplied name is taken from $key. If $inGroup is supplied it will place the accumulator under the specified group.
Definition at line ezdebug.php.
References isDebugEnabled(). |
| eZDebug::createAccumulatorGroup |
( |
$ |
key, |
|
|
$ |
name = false |
|
) |
|
|
| & eZDebug::dumpVariable |
( |
$ |
var |
) |
[static, private] |
|
| eZDebug::errorHandler |
( |
$ |
errno, |
|
|
$ |
errstr, |
|
|
$ |
errfile, |
|
|
$ |
errline |
|
) |
|
|
|
|
Handles PHP errors, creates notice, warning and error messages for the various PHP error types.
Definition at line ezdebug.php.
References writeWarning(). |
| eZDebug::isDebugEnabled |
( |
|
) |
[static] |
|
| eZDebug::isLogFileEnabled |
( |
$ |
type |
) |
|
|
|
|
Returns an associative array of all the log files used by this class where each key is the debug level (EZ_LEVEL_NOTICE, EZ_LEVEL_WARNING or EZ_LEVEL_ERROR or EZ_LEVEL_DEBUG).
Definition at line ezdebug.php.
References LogFiles.
Referenced by write(). |
| eZDebug::maxLogrotateFiles |
( |
|
) |
[static] |
|
| eZDebug::maxLogSize |
( |
|
) |
[static] |
|
| eZDebug::messageName |
( |
$ |
messageType |
) |
|
|
| eZDebug::messageTypes |
( |
|
) |
|
|
| & eZDebug::printReport |
( |
$ |
newWindow = false, |
|
|
$ |
as_html = true, |
|
|
$ |
returnReport = false |
|
) |
[static] |
|
| & eZDebug::printReportInternal |
( |
$ |
as_html = true |
) |
[private] |
|
|
|
Prints a full debug report with notice, warnings, errors and a timing report.
Definition at line ezdebug.php.
References UseCSS. |
| eZDebug::rotateLog |
( |
$ |
fileName |
) |
[static] |
|
| eZDebug::setHandleType |
( |
$ |
type |
) |
|
|
|
|
Determines how PHP errors are handled. If $type is EZ_HANDLE_TO_PHP all error messages is sent to PHP using trigger_error(), if $type is EZ_HANDLE_FROM_PHP all error messages from PHP is fetched using a custom error handler and output as a usual eZDebug message. If $type is EZ_HANDLE_NONE there is no error exchange between PHP and eZDebug.
Definition at line ezdebug.php.
References instance().
Referenced by writeFile(). |
| eZDebug::setLogFileEnabled |
( |
$ |
enabled, |
|
|
$ |
types = false |
|
) |
[static] |
|
|
|
Enables or disables logging to file for a given message type. If $types is not supplied it will do the operation for all types.
Definition at line ezdebug.php.
References messageTypes().
Referenced by writeFile(). |
| eZDebug::setLogrotateFiles |
( |
$ |
files |
) |
[static] |
|
|
|
Sets the maxium number of logrotate files to keep to $files.
Definition at line ezdebug.php. |
| eZDebug::setMaxLogSize |
( |
$ |
size |
) |
[static] |
|
|
|
Sets the maxium size for a log file to $size.
Definition at line ezdebug.php. |
| eZDebug::setMessageOutput |
( |
$ |
output |
) |
|
|
|
|
Determines the way messages are output, the $output parameter is EZ_OUTPUT_MESSAGE_SCREEN and EZ_OUTPUT_MESSAGE_STORE ored together.
Definition at line ezdebug.php.
References MessageOutput. |
| eZDebug::setScriptStart |
( |
$ |
mtime = false |
) |
|
|
|
|
Sets the time of the start of the script ot $mtime. If $mtime is not supplied it gets the current microtime(). This is used to calculate total execution time and percentages.
Definition at line ezdebug.php.
References timeToFloat(). |
| eZDebug::setUseExternalCSS |
( |
$ |
use |
) |
|
|
|
|
Enables/disables the use of external CSS. If false a <style> tag is output before the debug list. Default is to use internal css.
Definition at line ezdebug.php.
References UseCSS. |
| eZDebug::showMessage |
( |
$ |
type |
) |
[static] |
|
| eZDebug::showTypes |
( |
$ |
types = false |
) |
[static] |
|
|
|
Sets types to be shown to $types and returns the old show types. If $types is not supplied the current value is returned and no change is done. $types is one or more of EZ_SHOW_NOTICE, EZ_SHOW_WARNING, EZ_SHOW_ERROR, EZ_SHOW_TIMING_POINT or'ed together.
Definition at line ezdebug.php.
References ShowTypes. |
| & eZDebug::timeToFloat |
( |
$ |
mtime |
) |
[private] |
|
|
|
Returns the microtime as a float value. $mtime must be in microtime() format.
Definition at line ezdebug.php.
Referenced by setScriptStart(). |
| eZDebug::updateSettings |
( |
$ |
settings |
) |
[static] |
|
|
|
Updates the settings for debug handling with the settings array $settings. The array must contain the following keys.
- debug-enabled - boolean which controls debug handling
- debug-by-ip - boolean which controls IP controlled debugging
- debug-ip-list - array of IPs which gets debug
Definition at line ezdebug.php.
References setHandleType(). |
| eZDebug::write |
( |
$ |
string, |
|
|
$ |
verbosityLevel = EZ_LEVEL_NOTICE, |
|
|
$ |
label = "" |
|
) |
|
|
| eZDebug::writeDebug |
( |
$ |
string, |
|
|
$ |
label = "" |
|
) |
[static] |
|
| eZDebug::writeError |
( |
$ |
string, |
|
|
$ |
label = "" |
|
) |
[static] |
|
| eZDebug::writeFile |
( |
&$ |
logFileData, |
|
|
&$ |
string, |
|
|
$ |
verbosityLevel |
|
) |
[private] |
|
| eZDebug::writeNotice |
( |
$ |
string, |
|
|
$ |
label = "" |
|
) |
[static] |
|
| eZDebug::writeWarning |
( |
$ |
string, |
|
|
$ |
label = "" |
|
) |
[static] |
|
Member Data Documentation
eZDebug::DebugStrings = array() [private]
|
|
|
|
String array containing the debug information
Definition at line ezdebug.php.
Referenced by write(). |
The documentation for this class was generated from the following file:
|