Packageorg.as3commons.logging.setup.target
Classpublic class ConditionalBuffer
InheritanceConditionalBuffer Inheritance Object
Implements IAsyncLogTarget
Subclasses FatalBuffer

Since : 2.5

A ConditionalBuffer stores statements sent to it until a certain condition is met. In that case it will forward all stored statements to the defined target.

As target a ILogTarget or a LoggerFactory is an option.

This is a abstract class. Use implementations like FatalBuffer. They override the test method to implement conditions.

See also

org.as3commons.logging.setup.target.FatalBuffer


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.
ConditionalBuffer
  logFactory : LoggerFactory
[write-only] LoggerFactory to be called with all the buffered statements, once the condition has been reached.
ConditionalBuffer
  logTarget : ILogTarget
[write-only] ILogTarget to be called with all the buffered statements, once the condition has been reached.
ConditionalBuffer
  maxStatements : uint
[write-only] Maximum amount of statements buffered, if the buffer is full, the old statements will be dropped
ConditionalBuffer
  target : *
[write-only] Target to be called with all the buffered statements, once the condition has been reached.
ConditionalBuffer
Public Methods
 MethodDefined By
  
ConditionalBuffer(target:*, maxStatements:uint, introspectDepth:uint = 5)
Constructs a new ConditionalBuffer instance.
ConditionalBuffer
  
log(name:String, shortName:String, level:int, timeStamp:Number, message:*, params:Array, person:String):void
Renders a log statement.
ConditionalBuffer
Protected Methods
 MethodDefined By
  
test(name:String, shortName:String, level:int, timeStamp:Number, message:*, params:Array, person:String):Boolean
Tests the
ConditionalBuffer
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
logFactoryproperty 
logFactory:LoggerFactory  [write-only]

LoggerFactory to be called with all the buffered statements, once the condition has been reached.


Implementation
    public function set logFactory(value:LoggerFactory):void
logTargetproperty 
logTarget:ILogTarget  [write-only]

ILogTarget to be called with all the buffered statements, once the condition has been reached.


Implementation
    public function set logTarget(value:ILogTarget):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
targetproperty 
target:*  [write-only]

Target to be called with all the buffered statements, once the condition has been reached.


Implementation
    public function set target(value:any):void
Constructor Detail
ConditionalBuffer()Constructor
public function ConditionalBuffer(target:*, maxStatements:uint, introspectDepth:uint = 5)

Constructs a new ConditionalBuffer instance.

Parameters
target:* — Target that should receive the log statements.
 
maxStatements:uint (default = NaN) — Max amount of statements to be buffered.
 
introspectDepth:uint (default = 5)
Method Detail
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.

test()method 
protected function test(name:String, shortName:String, level:int, timeStamp:Number, message:*, params:Array, person:String):Boolean

Tests the

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 — Time stamp of when the log statement got 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.

Returns
Boolean