Package | com.lightstreamer.as_client.logger |
Class | public class DataGridAppender |
Inheritance | DataGridAppender ![]() |
Implements | LoggerListener |
The DataGridAppender is a simple LoggerListener implementation that extends the ArrayCollection class. It writes log lines received from the Logger to which it was added on its internal structure. As any ArrayCollection subclass it can be set as dataProvider property to any instance of ListBase or subclasses to show the log on a visual widget.
The following fields are generated on the model for each log line:
A suitable widget to display the log lines has to be provided by application code.
Example usage:
var gridAppender:DataGridAppender = new DataGridAppender(Logger.DEBUG,300); myLogView.dataProvider = gridAppender; var logger:Logger = Logger.getLogger("com.lightstreamer.as_client.LSClient"); logger.addLoggerListener(gridAppender);
where "myLogView" is a DataGrid which defines a dataField for each model field.
Default MXML Propertysource
See also
Method | Defined By | ||
---|---|---|---|
DataGridAppender(level:uint = 0, maxLines:uint = 250)
Constructor for DataGridAppender. | DataGridAppender | ||
clear():void
Removes all log lines from internal structures. | DataGridAppender | ||
getLevel():uint
Return the actual threshold level of the listener instance. | DataGridAppender | ||
getLinesLimit():uint
Returns the limit on the size of the history of log lines
to be left in the internal collection. | DataGridAppender | ||
log(loggerName:String, level:String, mex:String):void
Receive log messages from the Logger instances to which it was added and from their sons. | DataGridAppender | ||
setLevel(level:uint):void
Change the threshold level for the listener. | DataGridAppender | ||
setLinesLimit(maxLines:uint):void
Puts a limit on the size of the history of log lines to be left
in the internal collection. | DataGridAppender |
DataGridAppender | () | Constructor |
public function DataGridAppender(level:uint = 0, maxLines:uint = 250)
Constructor for DataGridAppender.
Parameterslevel:uint (default = 0 ) — the threshold level at which the DataGridAppender is created.
It should be one of DEBUG INFO WARN ERROR.
| |
maxLines:uint (default = 250 ) — the maximum number of log lines to be stored on the internal structure.
Once this limit is reached, older lines are deleted. Use a 0 value to set no limits.
|
See also
clear | () | method |
public function clear():void
Removes all log lines from internal structures. It is just an alias for the removeAll method.
See also
getLevel | () | method |
public function getLevel():uint
Return the actual threshold level of the listener instance. This method is used by the Logger engine to determine whether or not to send a message to the listener.
Returnsuint — the level of the listener instance. It should be one of DEBUG INFO WARN ERROR.
|
getLinesLimit | () | method |
public function getLinesLimit():uint
Returns the limit on the size of the history of log lines to be left in the internal collection.
Returnsuint — the history size limit, or 0 if no limit is set.
|
log | () | method |
public function log(loggerName:String, level:String, mex:String):void
Receive log messages from the Logger instances to which it was added and from their sons.
Parameters
loggerName:String — the name of the Logger instance that has published the message.
| |
level:String — the string version of the level of the message.
| |
mex:String — the message.
|
setLevel | () | method |
public function setLevel(level:uint):void
Change the threshold level for the listener.
Parameters
level:uint — the new threshold level. It should be one of
DEBUG INFO WARN ERROR.
|
setLinesLimit | () | method |
public function setLinesLimit(maxLines:uint):void
Puts a limit on the size of the history of log lines to be left in the internal collection. If never called, no limit is set.
Parameters
maxLines:uint — the new history size limit, or 0 to remove the limit.
|