| Package | com.smartfoxserver.v2.logging |
| Class | public class LoggerEvent |
| Inheritance | LoggerEvent BaseEvent flash.events.Event |
The LoggerEvent parent class provides a public property called params which contains specific parameters depending on the event type.
See also
| Method | Defined By | ||
|---|---|---|---|
LoggerEvent(type:String, params:Object = null)
Creates a new LoggerEvent instance. | LoggerEvent | ||
clone():Event [override]
Duplicates the instance of the LoggerEvent object. | LoggerEvent | ||
toString():String [override]
Generates a string containing all the properties of the LoggerEvent object. | LoggerEvent | ||
| Constant | Defined By | ||
|---|---|---|---|
| DEBUG : String = debug [static]
The LoggerEvent.DEBUG constant defines the value of the type property of the event object for a debug event. | LoggerEvent | ||
| ERROR : String = error [static]
The LoggerEvent.ERROR constant defines the value of the type property of the event object for a error event. | LoggerEvent | ||
| INFO : String = info [static]
The LoggerEvent.INFO constant defines the value of the type property of the event object for a info event. | LoggerEvent | ||
| WARNING : String = warn [static]
The LoggerEvent.WARNING constant defines the value of the type property of the event object for a warn event. | LoggerEvent | ||
| LoggerEvent | () | Constructor |
public function LoggerEvent(type:String, params:Object = null)Creates a new LoggerEvent instance.
Parameterstype:String — The type of event.
| |
params:Object (default = null) — An object containing the parameters of the event.
|
| clone | () | method |
override public function clone():EventDuplicates the instance of the LoggerEvent object.
ReturnsEvent — A new LoggerEvent object that is identical to the original.
|
| toString | () | method |
override public function toString():StringGenerates a string containing all the properties of the LoggerEvent object.
ReturnsString — A string containing all the properties of the LoggerEvent object.
|
| DEBUG | Constant |
public static const DEBUG:String = debugThe LoggerEvent.DEBUG constant defines the value of the type property of the event object for a debug event.
The properties of the params object contained in the event object have the following values:
| Property | Type | Description |
|---|---|---|
| message | String | The logged debug message. |
| ERROR | Constant |
public static const ERROR:String = errorThe LoggerEvent.ERROR constant defines the value of the type property of the event object for a error event.
The properties of the params object contained in the event object have the following values:
| Property | Type | Description |
|---|---|---|
| message | String | The logged error message. |
| INFO | Constant |
public static const INFO:String = infoThe LoggerEvent.INFO constant defines the value of the type property of the event object for a info event.
The properties of the params object contained in the event object have the following values:
| Property | Type | Description |
|---|---|---|
| message | String | The logged information message. |
| WARNING | Constant |
public static const WARNING:String = warnThe LoggerEvent.WARNING constant defines the value of the type property of the event object for a warn event.
The properties of the params object contained in the event object have the following values:
| Property | Type | Description |
|---|---|---|
| message | String | The logged warning message. |
private function someMethod():void
{
var logger:Logger = sfs.logger;
logger.addEventListener(LoggerEvent.ERROR, onErrorLogged);
}
private function onErrorLogged(evt:LoggerEvent):void
{
// Write the error message in a log text area in the application interface
log.text = "The following error occurred: " + evt.params.message;
}