MultiPrinter

private CLASS
 

Class Description

Provides a one-to-many facade for logging a single message to multiple printers.

See Also

 

Listing

 

Constructor

MultiPrinter()
 

Fields

printers():Dictionary.<String, Printer>List of message receivers compliant with the Printer interface.
index():NumberValue used to generate a default index for the next printer added.
 

Properties

numPrinters():Number
read only
Count of printers currently in the list of message receivers.
printerKeys():Vector.<String>
read only
Keys for all printers currently in the list of message receivers.
 

Methods

print(message:String):voidRecord a log message.
add(printer:Printer, key:String=null):StringAdd a printer to the list of message recievers.
clear():voidRemove all printers from the list of message receivers.
remove(key:String):PrinterRemove a printer matching the provided key from the list of message recievers.
 

Details

 

Constructor

 

MultiPrinter()

public function MultiPrinter()

 

Fields

 

printers

protected printers():Dictionary.<String, Printer>

List of message receivers compliant with the Printer interface.

All printers in the list are printed to each time the print() method of this class is called.

See Also

 

index

protected index():Number

Value used to generate a default index for the next printer added.

 

Properties

 

numPrinters
read only

public numPrinters():Number

Count of printers currently in the list of message receivers.

returns
Number

The number of printers currently in the list of message receivers

 

printerKeys
read only

public printerKeys():Vector.<String>

Keys for all printers currently in the list of message receivers.

returns
Vector.<String>

A Vector of String keys. Keys can be used to remove a printer from the list of message receivers.

 

Methods

 

print()

public function print(message:String):void

Record a log message.

Message formatting occurs prior to this method being called.

message:String

The formatted message to be handled by a log receiver

 

add()

public function add(printer:Printer, key:String=null):String

Add a printer to the list of message recievers.

Each printer in the list will record any message send to the print() method of this class.

See Also

printer:Printer

A message receiver compliant with the Printer interface

key:String=null
optional

An optional key to store the printer under. When not provided, a default key is created.

returns
String

The key for the added printer. Can be used for removal.

 

clear()

public function clear():void

Remove all printers from the list of message receivers.

 

remove()

public function remove(key:String):Printer

Remove a printer matching the provided key from the list of message recievers.

See Also

key:String

A key to identify the printer to remove

returns
Printer

The Printer instance removed

 

 

 

 

 

 

 

 

 

 

log-ls 2018 pixeldroid
https://github.com/pixeldroid/log-ls
generated with lsdoc v1.0.0 (https://github.com/pixeldroid/lsdoc)