| Package | org.as3commons.logging.setup.target |
| Class | public final class BufferTarget |
| Inheritance | BufferTarget Object |
| Implements | IAsyncLogTarget |
| Since : | 2.5 |
BufferTarget allows to store log statements for a
unlimited amount of time for a optionally restrictable amount of statements.
A common use case for buffer targets is lazy configuration. Just
set a BufferTarget interrim as default target and flush it later to the
target of choice. For example:
var buffer: BufferTarget = new BufferTarget();
LOGGER_SETUP.setup = new SimpleTarget(buffer);
// After some loading
LOGGER_SETUP.setup = ... // your new setup
flushToTarget(buffer.statements);
See also
| Property | Defined By | ||
|---|---|---|---|
| introspectDepth : uint [write-only]
Asynchronous targets need to introspect variables to store them,
for that the introspection depth defines how deep the variables should
be serialized. | BufferTarget | ||
| maxStatements : uint [write-only]
Maximum amount of statements buffered, if the buffer is full,
the old statements will be dropped
| BufferTarget | ||
| statements : Array [read-only]
| BufferTarget | ||
| Method | Defined By | ||
|---|---|---|---|
BufferTarget(maxStatements:uint, introspectDepth:uint = 5, clone:Boolean = true)
Creates a new BufferTarget instance. | BufferTarget | ||
clear():void | BufferTarget | ||
log(name:String, shortName:String, level:int, timeStamp:Number, message:*, params:Array, person:String):void
Renders a log statement. | BufferTarget | ||
| introspectDepth | property |
introspectDepth:uint [write-only] Asynchronous targets need to introspect variables to store them, for that the introspection depth defines how deep the variables should be serialized. (default=uint.MAX_VALUE)
public function set introspectDepth(value:uint):void| maxStatements | property |
maxStatements:uint [write-only] Maximum amount of statements buffered, if the buffer is full, the old statements will be dropped
public function set maxStatements(value:uint):void| statements | property |
statements:Array [read-only]
public function get statements():Array| BufferTarget | () | Constructor |
public function BufferTarget(maxStatements:uint, introspectDepth:uint = 5, clone:Boolean = true)
Creates a new BufferTarget instance.
maxStatements:uint (default = NaN) — Amount of statements stored in this buffer
| |
introspectDepth:uint (default = 5) — Depth to be used to cache statements, needs to
be bigger than 0.
| |
clone:Boolean (default = true) — true if the target should actually introspect and clone the statements
|
Error — if introspectDepth is 0;
|
| clear | () | method |
public function clear():void
| log | () | method |
public function log(name:String, shortName:String, level:int, timeStamp:Number, message:*, params:Array, person:String):voidRenders a log statement.
In version 2.5 the person information was added and the time stamp
was modified to represent the local time rather than the time in gmt.
Add START_TIME to get the time in ms since 1970.
Parameters
name:String — Name of the logger that triggered the log statement.
| |
shortName:String — Shortened form of the name.
| |
level:int — Level of the log statement that got triggered.
| |
timeStamp:Number — getTimer() Timestame of when the log statement was triggered.
| |
message:* — Message of the log statement.
| |
params:Array — Parameters for the log statement.
| |
person:String — Information about the person that filed this log statement.
|