| 套件 | mx.logging |
| 介面 | public interface ILoggingTarget |
| 實作者 | AbstractTarget |
| 語言版本: | ActionScript 3.0 |
| 產品版本: | Flex 3 |
| 執行階段版本: | Flash Player 9, AIR 1.1 |
| 屬性 | 定義自 | ||
|---|---|---|---|
| filters : Array
In addition to the level setting, filters are used to
provide a psuedo-hierarchical mapping for processing only those events
for a given category. | ILoggingTarget | ||
| level : int
Provides access to the level this target is currently set at. | ILoggingTarget | ||
| 方法 | 定義自 | ||
|---|---|---|---|
Sets up this target with the specified logger. | ILoggingTarget | ||
Stops this target from receiving events from the specified logger. | ILoggingTarget | ||
filters | 屬性 |
filters:Array| 語言版本: | ActionScript 3.0 |
| 產品版本: | Flex 3 |
| 執行階段版本: | Flash Player 9, AIR 1.1 |
In addition to the level setting, filters are used to
provide a psuedo-hierarchical mapping for processing only those events
for a given category.
Each logger belongs to a category.
By convention these categories map to the fully qualified class name
in which the logger is used.
For example, a logger that is logging messages for the
mx.rpc.soap.WebService class would use
"mx.rpc.soap.WebService" as the parameter
to the Log.getLogger() call.
When messages are sent under this category only those targets that have
a filter which matches that category will receive notification of those
events.
Filter expressions may include a wildcard match, indicated with an
asterisk.
The wildcard must be the right most character in the expression.
For example: rpc*, mx.*, or *.
If an invalid expression is specified a InvalidFilterError
will be thrown.
No spaces or any of the following characters are valid within a filter
expression: []~$^&\/(){}<>+=`!#%?,:;'"@.
實作
public function get filters():Array public function set filters(value:Array):void範例
如何使用本範例
var traceLogger:ILoggingTarget = new TraceTarget();
traceLogger.filters = [ "mx.rpc.*", "mx.messaging.*" ];
Log.addTarget(traceLogger);
level | 屬性 |
level:int| 語言版本: | ActionScript 3.0 |
| 產品版本: | Flex 3 |
| 執行階段版本: | Flash Player 9, AIR 1.1 |
Provides access to the level this target is currently set at. Value values are:
LogEventLevel.FATALdesignates events that are very harmful and will eventually lead to application failureLogEventLevel.ERRORdesignates error events that might still allow the application to continue running.LogEventLevel.WARNdesignates events that could be harmful to the application operationLogEventLevel.INFOdesignates informational messages that highlight the progress of the application at coarse-grained level.LogEventLevel.DEBUGdesignates informational level messages that are fine grained and most helpful when debugging an application.LogEventLevel.ALLintended to force a target to process all messages.
實作
public function get level():int public function set level(value:int):voidaddLogger | () | 方法 |
public function addLogger(logger:ILogger):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | Flex 3 |
| 執行階段版本: | Flash Player 9, AIR 1.1 |
Sets up this target with the specified logger. This allows this target to receive log events from the specified logger.
Note: This method is called by the framework and should not be called by you directly.
參數
logger:ILogger — The ILogger that this target listens to.
|
removeLogger | () | 方法 |
public function removeLogger(logger:ILogger):void| 語言版本: | ActionScript 3.0 |
| 產品版本: | Flex 3 |
| 執行階段版本: | Flash Player 9, AIR 1.1 |
Stops this target from receiving events from the specified logger.
Note: This method is called by the framework and should not be called by you directly.
參數
logger:ILogger — The ILogger that this target ignores.
|
Tue Jun 12 2018, 03:47 PM Z