Packageorg.as3commons.logging.setup.target
Classpublic final class BufferTarget
InheritanceBufferTarget Inheritance Object
Implements IAsyncLogTarget

Since : 2.5

The 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

org.as3commons.logging.util.flushToTarget();
org.as3commons.logging.util.flushToFactory();


Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
Property Detail
introspectDepthproperty
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)


Implementation
    public function set introspectDepth(value:uint):void
maxStatementsproperty 
maxStatements:uint  [write-only]

Maximum amount of statements buffered, if the buffer is full, the old statements will be dropped


Implementation
    public function set maxStatements(value:uint):void
statementsproperty 
statements:Array  [read-only]


Implementation
    public function get statements():Array
Constructor Detail
BufferTarget()Constructor
public function BufferTarget(maxStatements:uint, introspectDepth:uint = 5, clone:Boolean = true)

Creates a new BufferTarget instance.

Parameters
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

Throws
Error — if introspectDepth is 0;
Method Detail
clear()method
public function clear():void

log()method 
public function log(name:String, shortName:String, level:int, timeStamp:Number, message:*, params:Array, person:String):void

Renders 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.