ILIAS
Release_4_0_x_branch Revision 61816
|
Public Member Functions | |
_classExists ($class) | |
Utility function which wraps PHP's class_exists() function to ensure consistent behavior between PHP versions 4 and 5. | |
& | factory ($handler, $name= '', $ident= '', $conf=array(), $level=PEAR_LOG_DEBUG) |
Attempts to return a concrete Log instance of type $handler. | |
& | singleton ($handler, $name= '', $ident= '', $conf=array(), $level=PEAR_LOG_DEBUG) |
Attempts to return a reference to a concrete Log instance of type $handler, only creating a new instance if no log instance with the same parameters currently exists. | |
open () | |
Abstract implementation of the open() method. | |
close () | |
Abstract implementation of the close() method. | |
flush () | |
Abstract implementation of the flush() method. | |
log ($message, $priority=null) | |
Abstract implementation of the log() method. | |
emerg ($message) | |
A convenience function for logging a emergency event. | |
alert ($message) | |
A convenience function for logging an alert event. | |
crit ($message) | |
A convenience function for logging a critical event. | |
err ($message) | |
A convenience function for logging a error event. | |
warning ($message) | |
A convenience function for logging a warning event. | |
notice ($message) | |
A convenience function for logging a notice event. | |
info ($message) | |
A convenience function for logging a information event. | |
debug ($message) | |
A convenience function for logging a debug event. | |
_extractMessage ($message) | |
Returns the string representation of the message data. | |
_getBacktraceVars ($depth) | |
Using debug_backtrace(), returns the file, line, and enclosing function name of the source code context from which log() was invoked. | |
_format ($format, $timestamp, $priority, $message) | |
Produces a formatted log line based on a format string and a set of variables representing the current log record and state. | |
priorityToString ($priority) | |
Returns the string representation of a PEAR_LOG_* integer constant. | |
stringToPriority ($name) | |
Returns the the PEAR_LOG_* integer constant for the given string representation of a priority name. | |
MASK ($priority) | |
Calculate the log mask for the given priority. | |
UPTO ($priority) | |
Calculate the log mask for all priorities up to the given priority. | |
MIN ($priority) | |
Calculate the log mask for all priorities greater than or equal to the given priority. | |
MAX ($priority) | |
Calculate the log mask for all priorities less than or equal to the given priority. | |
setMask ($mask) | |
Set and return the level mask for the current Log instance. | |
getMask () | |
Returns the current level mask. | |
_isMasked ($priority) | |
Check if the given priority is included in the current level mask. | |
getPriority () | |
Returns the current default priority. | |
setPriority ($priority) | |
Sets the default priority to the specified value. | |
attach (&$observer) | |
Adds a Log_observer instance to the list of observers that are listening for messages emitted by this Log instance. | |
detach ($observer) | |
Removes a Log_observer instance from the list of observers. | |
_announce ($event) | |
Informs each registered observer instance that a new message has been logged. | |
isComposite () | |
Indicates whether this is a composite class. | |
setIdent ($ident) | |
Sets this Log instance's identification string. | |
getIdent () | |
Returns the current identification string. |
Data Fields | |
$_opened = false | |
$_id = 0 | |
$_ident = '' | |
$_priority = PEAR_LOG_INFO | |
$_mask = PEAR_LOG_ALL | |
$_listeners = array() | |
$_formatMap |
Log::_announce | ( | $event | ) |
Informs each registered observer instance that a new message has been logged.
array | $event | A hash describing the log event. |
protected
Definition at line 811 of file Log.php.
Referenced by Log_null\log(), Log_syslog\log(), Log_composite\log(), Log_mcal\log(), Log_error_log\log(), Log_display\log(), Log_sqlite\log(), Log_daemon\log(), Log_firebug\log(), Log_console\log(), Log_mdb2\log(), Log_sql\log(), Log_win\log(), Log_mail\log(), and Log_file\log().
Log::_classExists | ( | $class | ) |
Utility function which wraps PHP's class_exists() function to ensure consistent behavior between PHP versions 4 and 5.
Autoloading behavior is always disabled.
string | $class | The name of the class whose existence should be tested. |
private
Definition at line 117 of file Log.php.
Referenced by factory().
Log::_extractMessage | ( | $message | ) |
Returns the string representation of the message data.
If $message is an object, _extractMessage() will attempt to extract the message text using a known method (such as a PEAR_Error object's getMessage() method). If a known method, cannot be found, the serialized representation of the object will be returned.
If the message data is already a string, it will be returned unchanged.
mixed | $message | The original message data. This may be a string or any object. |
protected
Definition at line 417 of file Log.php.
Referenced by Log_syslog\log(), Log_mcal\log(), Log_error_log\log(), Log_display\log(), Log_sqlite\log(), Log_daemon\log(), Log_firebug\log(), Log_console\log(), Log_mdb2\log(), Log_sql\log(), Log_win\log(), Log_mail\log(), and Log_file\log().
Log::_format | ( | $format, | |
$timestamp, | |||
$priority, | |||
$message | |||
) |
Produces a formatted log line based on a format string and a set of variables representing the current log record and state.
protected
Definition at line 530 of file Log.php.
References $file, $timestamp, _getBacktraceVars(), and priorityToString().
Referenced by Log_error_log\log(), Log_display\log(), Log_firebug\log(), Log_console\log(), Log_mail\log(), and Log_file\log().
Log::_getBacktraceVars | ( | $depth | ) |
Using debug_backtrace(), returns the file, line, and enclosing function name of the source code context from which log() was invoked.
int | $depth | The initial number of frames we should step back into the trace. |
private
Definition at line 472 of file Log.php.
References $file.
Referenced by _format().
Log::_isMasked | ( | $priority | ) |
Check if the given priority is included in the current level mask.
integer | $priority | The priority to check. |
protected
Definition at line 726 of file Log.php.
References MASK().
Referenced by Log_null\log(), Log_syslog\log(), Log_error_log\log(), Log_mcal\log(), Log_display\log(), Log_daemon\log(), Log_sqlite\log(), Log_firebug\log(), Log_console\log(), Log_mdb2\log(), Log_sql\log(), Log_win\log(), Log_mail\log(), and Log_file\log().
Log::alert | ( | $message | ) |
A convenience function for logging an alert event.
It will log a message at the PEAR_LOG_ALERT log level.
mixed | $message | String or object containing the message to log. |
public
Definition at line 293 of file Log.php.
References log(), and PEAR_LOG_ALERT.
Log::attach | ( | & | $observer | ) |
Adds a Log_observer instance to the list of observers that are listening for messages emitted by this Log instance.
object | $observer | The Log_observer instance to attach as a listener. |
boolean | True if the observer is successfully attached. |
public
Definition at line 769 of file Log.php.
Log::close | ( | ) |
Abstract implementation of the close() method.
Reimplemented in Log_file, Log_sql, Log_mail, Log_mdb2, Log_win, Log_daemon, Log_sqlite, Log_firebug, Log_console, Log_display, Log_error_log, Log_mcal, Log_syslog, Log_composite, and Log_null.
Definition at line 241 of file Log.php.
Log::crit | ( | $message | ) |
A convenience function for logging a critical event.
It will log a message at the PEAR_LOG_CRIT log level.
mixed | $message | String or object containing the message to log. |
public
Definition at line 310 of file Log.php.
References log(), and PEAR_LOG_CRIT.
Log::debug | ( | $message | ) |
A convenience function for logging a debug event.
It will log a message at the PEAR_LOG_DEBUG log level.
mixed | $message | String or object containing the message to log. |
public
Definition at line 395 of file Log.php.
References log(), and PEAR_LOG_DEBUG.
Log::detach | ( | $observer | ) |
Removes a Log_observer instance from the list of observers.
object | $observer | The Log_observer instance to detach from the list of listeners. |
boolean | True if the observer is successfully detached. |
public
Definition at line 791 of file Log.php.
Log::emerg | ( | $message | ) |
A convenience function for logging a emergency event.
It will log a message at the PEAR_LOG_EMERG log level.
mixed | $message | String or object containing the message to log. |
public
Definition at line 276 of file Log.php.
References log(), and PEAR_LOG_EMERG.
Log::err | ( | $message | ) |
A convenience function for logging a error event.
It will log a message at the PEAR_LOG_ERR log level.
mixed | $message | String or object containing the message to log. |
public
Definition at line 327 of file Log.php.
References log(), and PEAR_LOG_ERR.
& Log::factory | ( | $handler, | |
$name = '' , |
|||
$ident = '' , |
|||
$conf = array() , |
|||
$level = PEAR_LOG_DEBUG |
|||
) |
Attempts to return a concrete Log instance of type $handler.
string | $handler | The type of concrete Log subclass to return. Attempt to dynamically include the code for this subclass. Currently, valid values are 'console', 'syslog', 'sql', 'file', and 'mcal'. |
string | $name | The name of the actually log file, table, or other specific store to use. Defaults to an empty string, with which the subclass will attempt to do something intelligent. |
string | $ident | The identity reported to the log system. |
array | $conf | A hash containing any additional configuration information that a subclass might need. |
int | $level | Log messages up to and including this level. |
Definition at line 151 of file Log.php.
References $name, $null, and _classExists().
Referenced by Log_mail\close(), and singleton().
Log::flush | ( | ) |
Abstract implementation of the flush() method.
Reimplemented in Log_file, Log_mail, Log_console, Log_firebug, and Log_composite.
Definition at line 250 of file Log.php.
Log::getIdent | ( | ) |
Log::getMask | ( | ) |
Log::getPriority | ( | ) |
Returns the current default priority.
public
Definition at line 739 of file Log.php.
References $_priority.
Log::info | ( | $message | ) |
A convenience function for logging a information event.
It will log a message at the PEAR_LOG_INFO log level.
mixed | $message | String or object containing the message to log. |
public
Definition at line 378 of file Log.php.
References log(), and PEAR_LOG_INFO.
Log::isComposite | ( | ) |
Indicates whether this is a composite class.
public
Reimplemented in Log_composite.
Definition at line 828 of file Log.php.
Log::log | ( | $message, | |
$priority = null |
|||
) |
Abstract implementation of the log() method.
Reimplemented in Log_file, Log_mail, Log_win, Log_sql, Log_mdb2, Log_console, Log_firebug, Log_daemon, Log_sqlite, Log_display, Log_error_log, Log_mcal, Log_composite, Log_syslog, and Log_null.
Definition at line 259 of file Log.php.
Referenced by alert(), crit(), debug(), emerg(), err(), info(), notice(), and warning().
Log::MASK | ( | $priority | ) |
Calculate the log mask for the given priority.
This method may be called statically.
integer | $priority | The priority whose mask will be calculated. |
public
Definition at line 623 of file Log.php.
Referenced by _isMasked().
Log::MAX | ( | $priority | ) |
Calculate the log mask for all priorities less than or equal to the given priority.
In other words, $priority will be the highests priority matched by the resulting mask.
This method may be called statically.
integer | $priority | The maximum priority covered by this mask. |
public
Definition at line 680 of file Log.php.
Referenced by UPTO().
Log::MIN | ( | $priority | ) |
Calculate the log mask for all priorities greater than or equal to the given priority.
In other words, $priority will be the lowest priority matched by the resulting mask.
This method may be called statically.
integer | $priority | The minimum priority covered by this mask. |
public
Definition at line 661 of file Log.php.
References PEAR_LOG_ALL.
Log::notice | ( | $message | ) |
A convenience function for logging a notice event.
It will log a message at the PEAR_LOG_NOTICE log level.
mixed | $message | String or object containing the message to log. |
public
Definition at line 361 of file Log.php.
References log(), and PEAR_LOG_NOTICE.
Log::open | ( | ) |
Abstract implementation of the open() method.
Reimplemented in Log_file, Log_mail, Log_sql, Log_mdb2, Log_daemon, Log_console, Log_win, Log_firebug, Log_display, Log_error_log, Log_sqlite, Log_mcal, Log_syslog, Log_composite, and Log_null.
Definition at line 232 of file Log.php.
Log::priorityToString | ( | $priority | ) |
Returns the string representation of a PEAR_LOG_* integer constant.
int | $priority | A PEAR_LOG_* integer constant. |
public
Definition at line 566 of file Log.php.
References PEAR_LOG_ALERT, PEAR_LOG_CRIT, PEAR_LOG_DEBUG, PEAR_LOG_EMERG, PEAR_LOG_ERR, PEAR_LOG_INFO, PEAR_LOG_NOTICE, and PEAR_LOG_WARNING.
Referenced by _format(), and Log_win\log().
Log::setIdent | ( | $ident | ) |
Log::setMask | ( | $mask | ) |
Log::setPriority | ( | $priority | ) |
& Log::singleton | ( | $handler, | |
$name = '' , |
|||
$ident = '' , |
|||
$conf = array() , |
|||
$level = PEAR_LOG_DEBUG |
|||
) |
Attempts to return a reference to a concrete Log instance of type $handler, only creating a new instance if no log instance with the same parameters currently exists.
You should use this if there are multiple places you might create a logger, you don't want to create multiple loggers, and you don't want to check for the existance of one each time. The singleton pattern does all the checking work for you.
You MUST call this method with the $var = &Log::singleton() syntax. Without the ampersand (&) in front of the method name, you will not get a reference, you will get a copy.
string | $handler | The type of concrete Log subclass to return. Attempt to dynamically include the code for this subclass. Currently, valid values are 'console', 'syslog', 'sql', 'file', and 'mcal'. |
string | $name | The name of the actually log file, table, or other specific store to use. Defaults to an empty string, with which the subclass will attempt to do something intelligent. |
string | $ident | The identity reported to the log system. |
array | $conf | A hash containing any additional configuration information that a subclass might need. |
int | $level | Log messages up to and including this level. |
Definition at line 213 of file Log.php.
References $name, and factory().
Referenced by Auth\_loadLogger(), and Log_mdb2\Log_mdb2().
Log::stringToPriority | ( | $name | ) |
Returns the the PEAR_LOG_* integer constant for the given string representation of a priority name.
This function performs a case-insensitive search.
string | $name | String containing a priority name. |
public
Definition at line 595 of file Log.php.
References $name, PEAR_LOG_ALERT, PEAR_LOG_CRIT, PEAR_LOG_DEBUG, PEAR_LOG_EMERG, PEAR_LOG_ERR, PEAR_LOG_INFO, PEAR_LOG_NOTICE, and PEAR_LOG_WARNING.
Log::UPTO | ( | $priority | ) |
Calculate the log mask for all priorities up to the given priority.
This method may be called statically.
integer | $priority | The maximum priority covered by this mask. |
public
Definition at line 642 of file Log.php.
References MAX().
Referenced by Log_console\Log_console(), Log_daemon\Log_daemon(), Log_display\Log_display(), Log_error_log\Log_error_log(), Log_file\Log_file(), Log_firebug\Log_firebug(), Log_mail\Log_mail(), Log_mcal\Log_mcal(), Log_mdb2\Log_mdb2(), Log_null\Log_null(), Log_sql\Log_sql(), Log_sqlite\Log_sqlite(), Log_syslog\Log_syslog(), and Log_win\Log_win().
Log::warning | ( | $message | ) |
A convenience function for logging a warning event.
It will log a message at the PEAR_LOG_WARNING log level.
mixed | $message | String or object containing the message to log. |
public
Definition at line 344 of file Log.php.
References log(), and PEAR_LOG_WARNING.
Log::$_formatMap |
Log::$_ident = '' |
Definition at line 61 of file Log.php.
Referenced by getIdent(), and Log_mdb2\log().
Log::$_mask = PEAR_LOG_ALL |
Log::$_opened = false |
Definition at line 45 of file Log.php.
Referenced by Log_composite\open(), Log_syslog\open(), Log_mcal\open(), Log_sqlite\open(), Log_win\open(), Log_daemon\open(), Log_mdb2\open(), Log_sql\open(), Log_mail\open(), and Log_file\open().
Log::$_priority = PEAR_LOG_INFO |
Definition at line 69 of file Log.php.
Referenced by getPriority(), Log_null\log(), Log_syslog\log(), Log_composite\log(), Log_mcal\log(), Log_error_log\log(), Log_display\log(), Log_daemon\log(), Log_sqlite\log(), Log_firebug\log(), Log_console\log(), Log_mdb2\log(), Log_sql\log(), Log_win\log(), Log_mail\log(), and Log_file\log().