alert [line 250]
boolean alert(
mixed
$message)
A convenience function for logging an alert event. It will log a message at the PEAR_LOG_ALERT log level.
- Return: True if the message was successfully logged.
- Since: Log 1.7.0
- Access: public
Parameters:
mixed
$message
—
String or object containing the message to log.
attach [line 540]
void attach(
&$observer, object
$observer, boolean
1)
Adds a Log_observer instance to the list of observers that are listening for messages emitted by this Log instance.
- Since: Log 1.0
- Access: public
Parameters:
object
$observer
—
The Log_observer instance to attach as a listener.
boolean
1
—
True if the observer is successfully attached.
&$observer
—
close [line 198]
Abstract implementation of the close() method.
Overridden in child classes as:
- Log_composite::close()
- Closes any child instances.
- Log_file::close()
- Closes the log file if it is open.
- Log_syslog::close()
- Closes the connection to the system logger, if it is open.
- Log_mail::close()
- Closes the message, if it is open, and sends the mail.
- Log_sql::close()
- Closes the connection to the database if it is still open and we were the ones that opened it. It is the caller's responsible to close an existing connection that was passed to us via $conf['db'].
- Log_sqlite::close()
- Closes the connection to the database if it is still open and we were the ones that opened it. It is the caller's responsible to close an existing connection that was passed to us via $conf['db'].
- Log_mcal::close()
- Closes the calendar stream, if it is open.
- Log_win::close()
- Closes the output stream if it is open. If there are still pending lines in the output buffer, the output window will be opened so that the buffer can be drained.
crit [line 267]
boolean crit(
mixed
$message)
A convenience function for logging a critical event. It will log a message at the PEAR_LOG_CRIT log level.
- Return: True if the message was successfully logged.
- Since: Log 1.7.0
- Access: public
Parameters:
mixed
$message
—
String or object containing the message to log.
debug [line 352]
boolean debug(
mixed
$message)
A convenience function for logging a debug event. It will log a message at the PEAR_LOG_DEBUG log level.
- Return: True if the message was successfully logged.
- Since: Log 1.7.0
- Access: public
Parameters:
mixed
$message
—
String or object containing the message to log.
detach [line 562]
void detach(
object
$observer, boolean
1)
Removes a Log_observer instance from the list of observers.
- Since: Log 1.0
- Access: public
Parameters:
object
$observer
—
The Log_observer instance to detach from the list of listeners.
boolean
1
—
True if the observer is successfully detached.
emerg [line 233]
boolean emerg(
mixed
$message)
A convenience function for logging a emergency event. It will log a message at the PEAR_LOG_EMERG log level.
- Return: True if the message was successfully logged.
- Since: Log 1.7.0
- Access: public
Parameters:
mixed
$message
—
String or object containing the message to log.
err [line 284]
boolean err(
mixed
$message)
A convenience function for logging a error event. It will log a message at the PEAR_LOG_ERR log level.
- Return: True if the message was successfully logged.
- Since: Log 1.7.0
- Access: public
Parameters:
mixed
$message
—
String or object containing the message to log.
factory [line 112]
object Log &factory(
string
$handler, [string
$name = ''], [string
$ident = ''], [array
$conf = array()], [int
$level = PEAR_LOG_DEBUG])
Attempts to return a concrete Log instance of type $handler.
- Return: The newly created concrete Log instance, or an false on an error.
- Since: Log 1.0
- Access: public
Parameters:
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.
flush [line 207]
getIdent [line 625]
Returns the current identification string.
- Return: The current Log instance's identification string.
- Since: Log 1.6.3
- Access: public
getMask [line 481]
Returns the current level mask.
- Return: The current level mask.
- Since: Log 1.7.0
- Access: public
getPriority [line 510]
Returns the current default priority.
- Return: The current default priority.
- Since: Log 1.8.4
- Access: public
info [line 335]
boolean info(
mixed
$message)
A convenience function for logging a information event. It will log a message at the PEAR_LOG_INFO log level.
- Return: True if the message was successfully logged.
- Since: Log 1.7.0
- Access: public
Parameters:
mixed
$message
—
String or object containing the message to log.
isComposite [line 599]
Indicates whether this is a composite class.
- Return: True if this is a composite class.
- Since: Log 1.0
- Access: public
Overridden in child classes as:
- Log_composite::isComposite()
- Returns true if this is a composite.
log [line 216]
void log(
$message, [
$priority = null])
Abstract implementation of the log() method.
Overridden in child classes as:
- Log_display::log()
- Writes $message to the text browser. Also, passes the message along to any Log_observer instances that are observing this Log.
- Log_composite::log()
- Sends $message and $priority to each child of this composite.
- Log_null::log()
- Simply consumes the log event. The message will still be passed along to any Log_observer instances that are observing this Log.
- Log_file::log()
- Logs $message to the output window. The message is also passed along to any Log_observer instances that are observing this Log.
- Log_syslog::log()
- Sends $message to the currently open syslog connection. Calls open() if necessary. Also passes the message along to any Log_observer instances that are observing this Log.
- Log_mail::log()
- Writes $message to the currently open mail message.
- Log_error_log::log()
- Logs $message using PHP's error_log() function. The message is also passed along to any Log_observer instances that are observing this Log.
- Log_sql::log()
- Inserts $message to the currently open database. Calls open(), if necessary. Also passes the message along to any Log_observer instances that are observing this Log.
- Log_sqlite::log()
- Inserts $message to the currently open database. Calls open(), if necessary. Also passes the message along to any Log_observer instances that are observing this Log.
- Log_mcal::log()
- Logs $message and associated information to the currently open calendar stream. Calls open() if necessary. Also passes the message along to any Log_observer instances that are observing this Log.
- Log_win::log()
- Logs $message to the output window. The message is also passed along to any Log_observer instances that are observing this Log.
- Log_console::log()
- Writes $message to the text console. Also, passes the message along to any Log_observer instances that are observing this Log.
Parameters:
MASK [line 436]
integer MASK(
integer
$priority)
Calculate the log mask for the given priority.
- Return: The calculated log mask.
- Since: Log 1.7.0
- Access: public
Parameters:
integer
$priority
—
The priority whose mask will be calculated.
notice [line 318]
boolean notice(
mixed
$message)
A convenience function for logging a notice event. It will log a message at the PEAR_LOG_NOTICE log level.
- Return: True if the message was successfully logged.
- Since: Log 1.7.0
- Access: public
Parameters:
mixed
$message
—
String or object containing the message to log.
open [line 189]
Abstract implementation of the open() method.
Overridden in child classes as:
- Log_composite::open()
- Opens the child connections.
- Log_file::open()
- Opens the log file for output. If the specified log file does not already exist, it will be created. By default, new log entries are appended to the end of the log file.
- Log_syslog::open()
- Opens a connection to the system logger, if it has not already been opened. This is implicitly called by log(), if necessary.
- Log_mail::open()
- Starts a new mail message.
- Log_sql::open()
- Opens a connection to the database, if it has not already been opened. This is implicitly called by log(), if necessary.
- Log_sqlite::open()
- Opens a connection to the database, if it has not already been opened. This is implicitly called by log(), if necessary.
- Log_mcal::open()
- Opens a calendar stream, if it has not already been opened. This is implicitly called by log(), if necessary.
- Log_win::open()
- The first time open() is called, it will open a new browser window and prepare it for output.
priorityToString [line 410]
string priorityToString(
int
$priority)
Returns the string representation of a PEAR_LOG_* integer constant.
- Return: The string representation of $level.
- Since: Log 1.0
Parameters:
int
$priority
—
A PEAR_LOG_* integer constant.
setIdent [line 612]
void setIdent(
string
$ident)
Sets this Log instance's identification string.
- Since: Log 1.6.3
- Access: public
Overridden in child classes as:
- Log_composite::setIdent()
- Sets this identification string for all of this composite's children.
- Log_sql::setIdent()
- Sets this Log instance's identification string. Note that this SQL-specific implementation will limit the length of the $ident string to sixteen (16) characters.
Parameters:
string
$ident
—
The new identification string.
setMask [line 466]
integer setMask(
integer
$mask)
Set and return the level mask for the current Log instance.
- Return: The current level mask.
- Since: Log 1.7.0
- Access: public
Parameters:
integer
$mask
—
A bitwise mask of log levels.
setPriority [line 523]
void setPriority(
integer
$priority)
Sets the default priority to the specified value.
- Since: Log 1.8.4
- Access: public
Parameters:
integer
$priority
—
The new default priority.
singleton [line 170]
object Log &singleton(
string
$handler, [string
$name = ''], [string
$ident = ''], [array
$conf = array()], [int
$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.
- Return: The newly created concrete Log instance, or an false on an error.
- Since: Log 1.0
- Access: public
Parameters:
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.
UPTO [line 451]
integer UPTO(
integer
$priority)
Calculate the log mask for all priorities up to the given priority.
- Return: The calculated log mask.
- Since: Log 1.7.0
- Access: public
Parameters:
integer
$priority
—
The maximum priority covered by this mask.
warning [line 301]
boolean warning(
mixed
$message)
A convenience function for logging a warning event. It will log a message at the PEAR_LOG_WARNING log level.
- Return: True if the message was successfully logged.
- Since: Log 1.7.0
- Access: public
Parameters:
mixed
$message
—
String or object containing the message to log.