AnewtLog Class Reference

The AnewtLog class provides static methods for logging. More...

List of all members.

Public Member Functions

 __construct ()
 Constructor throws an error.

Static Public Member Functions

static init ($setup_default_handler=false)
 Initializes the AnewtLog module.
static add_handler (&$handler, $level=ANEWT_LOG_LEVEL_MESSAGE)
 Adds a log handler to the list of log handlers.
static set_domain ($domain)
 Sets the current log domain to the specified domain.
static reset_domain ()
 Resets the log domain to the previous domain.
static get_domain ()
 Retrieves the current log domain.
static loglevel_to_string ($level)
 Converts a log level integer to a string representation.
static error ($message, $args=null)
 Log an error.
static error_with_domain ($domain, $message, $args=null)
 Log an error with a custom domain.
static critical ($message, $args=null)
 Log a critical warning.
static critical_with_domain ($domain, $message, $args=null)
 Log a critical warning with a custom domain.
static warning ($message, $args=null)
 Log a warning.
static warning_with_domain ($domain, $message, $args=null)
 Log a warning with a custom domain.
static message ($message, $args=null)
 Log a normal message.
static message_with_domain ($domain, $message, $args=null)
 Log a normal message with a custom domain.
static info ($message, $args=null)
 Log an informational message.
static info_with_domain ($domain, $message, $args=null)
 Log an informational message with a custom domain.
static debug ($message, $args=null)
 Log a debug message.
static debug_with_domain ($domain, $message, $args=null)
 Log a debug message with a custom domain.

Static Private Member Functions

static _is_initialized ()
 Checks if the AnewtLog module was initialized.
static _log ($level, $message, $args=null)
 Log a message to the output handlers.
static _log_with_domain ($domain, $level, $message, $args)
 Log a message to the output handlers, temporarily overriding the log domain.


Detailed Description

The AnewtLog class provides static methods for logging.

Definition at line 25 of file logging.lib.php.


Constructor & Destructor Documentation

AnewtLog::__construct (  ) 

Constructor throws an error.

Only static usage of this class is allowed.

Definition at line 30 of file logging.lib.php.


Member Function Documentation

static AnewtLog::init ( setup_default_handler = false  )  [static]

Initializes the AnewtLog module.

Parameters:
$setup_default_handler Whether to setup a default handler. If true, a new AnewtLogHandlerDefault instance with default level filtering will be initialized. This parameter defaults to false, which means a log handler needs to be added manually before using the logging facilities.

Definition at line 46 of file logging.lib.php.

static AnewtLog::add_handler ( &$  handler,
level = ANEWT_LOG_LEVEL_MESSAGE 
) [static]

Adds a log handler to the list of log handlers.

Parameters:
$handler A AnewtLogHandlerBase subclass instance
$level The minimum log level this handler should log messages for. The default is ANEWT_LOG_LEVEL_MESSAGE, which means that normal messages, warnings, critical warnings and errors are logged. Set to ANEWT_LOG_LEVEL_DEBUG to enable logging of all messages, set to ANEWT_LOG_LEVEL_WARNING to only log warnings and higher priority messages.

Definition at line 77 of file logging.lib.php.

static AnewtLog::_is_initialized (  )  [static, private]

Checks if the AnewtLog module was initialized.

Returns:
True if initialized, false otherwise.

Definition at line 96 of file logging.lib.php.

static AnewtLog::set_domain ( domain  )  [static]

Sets the current log domain to the specified domain.

Previous domain names will be remembered (stack-based).

Parameters:
$domain A string with the new domain name.
See also:
AnewtLog::reset_domain

AnewtLog::get_domain

Definition at line 112 of file logging.lib.php.

static AnewtLog::reset_domain (  )  [static]

Resets the log domain to the previous domain.

Returns:
The current log domain.
See also:
AnewtLog::set_domain

AnewtLog::get_domain

Definition at line 127 of file logging.lib.php.

static AnewtLog::get_domain (  )  [static]

Retrieves the current log domain.

Returns:
The current log domain.
See also:
AnewtLog::set_domain

AnewtLog::reset_domain

Definition at line 141 of file logging.lib.php.

static AnewtLog::loglevel_to_string ( level  )  [static]

Converts a log level integer to a string representation.

Parameters:
$level The log level to convert, eg. ANEWT_LOG_LEVEL_MESSAGE
Returns:
The name for this log level.

Definition at line 156 of file logging.lib.php.

static AnewtLog::_log ( level,
message,
args = null 
) [static, private]

Log a message to the output handlers.

Parameters:
$level The message log level. This should be one of the ANEWT_LOG_LEVEL_* constants.
$message The message itself. sprintf-style placeholders can be specified.
$args An array with data (optional). These values will be substituted for the placeholders in $message.

Definition at line 187 of file logging.lib.php.

static AnewtLog::_log_with_domain ( domain,
level,
message,
args 
) [static, private]

Log a message to the output handlers, temporarily overriding the log domain.

Parameters:
$domain The temporary log domain
$level 
$message 
$args 
See also:
AnewtLog::_log

Definition at line 228 of file logging.lib.php.

static AnewtLog::error ( message,
args = null 
) [static]

Log an error.

Parameters:
$message The message to log, with optional sprintf-style placeholders.
$args One or more parameters (or a single array) with values that will be substituted for the placeholders in $message.

Definition at line 247 of file logging.lib.php.

static AnewtLog::error_with_domain ( domain,
message,
args = null 
) [static]

Log an error with a custom domain.

This is particularly useful for library routines.

Parameters:
$domain The custom domain
$message 
$args 
See also:
AnewtLog::error

Definition at line 264 of file logging.lib.php.

static AnewtLog::critical ( message,
args = null 
) [static]

Log a critical warning.

Parameters:
$message 
$args 
See also:
AnewtLog::error

Definition at line 281 of file logging.lib.php.

static AnewtLog::critical_with_domain ( domain,
message,
args = null 
) [static]

Log a critical warning with a custom domain.

Parameters:
$domain 
$message 
$args 
See also:
AnewtLog::error_with_domain

Definition at line 295 of file logging.lib.php.

static AnewtLog::warning ( message,
args = null 
) [static]

Log a warning.

Parameters:
$message 
$args 
See also:
AnewtLog::error

Definition at line 312 of file logging.lib.php.

static AnewtLog::warning_with_domain ( domain,
message,
args = null 
) [static]

Log a warning with a custom domain.

Parameters:
$domain 
$message 
$args 
See also:
AnewtLog::error_with_domain

Definition at line 326 of file logging.lib.php.

static AnewtLog::message ( message,
args = null 
) [static]

Log a normal message.

Parameters:
$message 
$args 
See also:
AnewtLog::error

Definition at line 344 of file logging.lib.php.

static AnewtLog::message_with_domain ( domain,
message,
args = null 
) [static]

Log a normal message with a custom domain.

Parameters:
$domain 
$message 
$args 
See also:
AnewtLog::error_with_domain

Definition at line 358 of file logging.lib.php.

static AnewtLog::info ( message,
args = null 
) [static]

Log an informational message.

Parameters:
$message 
$args 
See also:
AnewtLog::error

Definition at line 375 of file logging.lib.php.

static AnewtLog::info_with_domain ( domain,
message,
args = null 
) [static]

Log an informational message with a custom domain.

Parameters:
$domain 
$message 
$args 
See also:
AnewtLog::error_with_domain

Definition at line 389 of file logging.lib.php.

static AnewtLog::debug ( message,
args = null 
) [static]

Log a debug message.

Parameters:
$message 
$args 
See also:
AnewtLog::error

Definition at line 407 of file logging.lib.php.

static AnewtLog::debug_with_domain ( domain,
message,
args = null 
) [static]

Log a debug message with a custom domain.

Parameters:
$domain 
$message 
$args 
See also:
AnewtLog::error_with_domain

Definition at line 421 of file logging.lib.php.


The documentation for this class was generated from the following file:

Generated on Sun Aug 2 22:54:38 2009 for Anewt by  doxygen 1.5.9