Class TLogger
TLogger class.
TLogger records log messages in memory and implements the methods to retrieve the messages with filter conditions, including log levels, log categories, and by control.
- TComponent
-
TLogger
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Qiang Xue <qiang.xue@gmail.com>
Since: 3.0
Located at Util/TLogger.php
public
|
#
log( string $message, integer $level, string $category = 'Uncategorized', string|
Logs a message. Messages logged by this method may be retrieved via |
public
array
|
#
getLogs( integer $levels = null, array $categories = null, array $controls = null, mixed $timestamp = null )
Retrieves log messages. Messages may be filtered by log levels and/or categories and/or control client ids and/or timestamp. A level filter is specified by an integer, whose bits indicate the levels interested. For example, (TLogger::INFO | TLogger::WARNING) specifies INFO and WARNING levels. A category filter is specified by an array of categories to filter. A message whose category name starts with any filtering category will be returned. For example, a category filter array('System.Web','System.IO') will return messages under categories such as 'System.Web', 'System.IO', 'System.Web.UI', 'System.Web.UI.WebControls', etc. A control client id filter is specified by an array of control client id A message whose control client id starts with any filtering naming panels will be returned. For example, a category filter array('ctl0_body_header', 'ctl0_body_content_sidebar') will return messages under categories such as 'ctl0_body_header', 'ctl0_body_content_sidebar', 'ctl0_body_header_title', 'ctl0_body_content_sidebar_savebutton', etc. A timestamp filter is specified as an interger or float number. A message whose registered timestamp is less or equal the filter value will be returned. Level filter, category filter, control filter and timestamp filter are combinational, i.e., only messages satisfying all filter conditions will they be returned. |
public
|
#
deleteLogs( integer $levels = null, array $categories = null, array $controls = null, mixed $timestamp = null )
Deletes log messages from the queue. Messages may be filtered by log levels and/or categories and/or control client ids and/or timestamp. A level filter is specified by an integer, whose bits indicate the levels interested. For example, (TLogger::INFO | TLogger::WARNING) specifies INFO and WARNING levels. A category filter is specified by an array of categories to filter. A message whose category name starts with any filtering category will be deleted. For example, a category filter array('System.Web','System.IO') will delete messages under categories such as 'System.Web', 'System.IO', 'System.Web.UI', 'System.Web.UI.WebControls', etc. A control client id filter is specified by an array of control client id A message whose control client id starts with any filtering naming panels will be deleted. For example, a category filter array('ctl0_body_header', 'ctl0_body_content_sidebar') will delete messages under categories such as 'ctl0_body_header', 'ctl0_body_content_sidebar', 'ctl0_body_header_title', 'ctl0_body_content_sidebar_savebutton', etc. A timestamp filter is specified as an interger or float number. A message whose registered timestamp is less or equal the filter value will be returned. Level filter, category filter, control filter and timestamp filter are combinational, i.e., only messages satisfying all filter conditions will they be returned. |
integer |
DEBUG |
0x01 |
#
Log levels. |
integer |
INFO |
0x02 |
|
integer |
NOTICE |
0x04 |
|
integer |
WARNING |
0x08 |
|
integer |
ERROR |
0x10 |
|
integer |
ALERT |
0x20 |
|
integer |
FATAL |
0x40 |
GLOBAL_RAISE_EVENT_LISTENER
|