PHP 클래스 Prado\Util\TLogger

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.
부터: 3.0
저자: Qiang Xue ([email protected])
상속: extends Prado\TComponent
파일 보기 프로젝트 열기: pradosoft/prado

공개 메소드들

메소드 설명
deleteLogs ( $levels = null, $categories = null, $controls = null, $timestamp = null ) Deletes log messages from the queue.
getLogs ( $levels = null, $categories = null, $controls = null, $timestamp = null ) : array Retrieves log messages.
log ( $message, $level, $category = 'Uncategorized', $ctl = null ) Logs a message.

비공개 메소드들

메소드 설명
filterByCategories ( $value ) Filter function used by {@link getLogs}.
filterByControl ( $value ) Filter function used by {@link getLogs}
filterByLevels ( $value ) Filter function used by {@link getLogs}
filterByTimeStamp ( $value ) Filter function used by {@link getLogs}

메소드 상세

deleteLogs() 공개 메소드

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.
public deleteLogs ( $levels = null, $categories = null, $controls = null, $timestamp = null )

getLogs() 공개 메소드

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 getLogs ( $levels = null, $categories = null, $controls = null, $timestamp = null ) : array
리턴 array list of messages. Each array elements represents one message with the following structure: array( [0] => message [1] => level [2] => category [3] => timestamp (by microtime(), float number)); [4] => memory in bytes [5] => control client id

log() 공개 메소드

Messages logged by this method may be retrieved via {@link getLogs}.
public log ( $message, $level, $category = 'Uncategorized', $ctl = null )