LoggerAddEventListener Method |
Namespace: Sfs2X.Logging
public void AddEventListener( LogLevel level, EventListenerDelegate listener )
void SomeMethod() { sfs.logger.EnableEventDispatching = true; sfs.Logger.AddEventListener(LogLevel.INFO, OnInfoLogMessage); sfs.Logger.AddEventListener(LogLevel.WARN, OnWarnLogMessage); } void OnInfoLogMessage(BaseEvent evt) { string message = (string)evt.Params["message"]; Console.WriteLine("[SFS2X INFO] " + message); // .Net / Unity System.Diagnostics.Debug.WriteLine("[SFS2X INFO] " + message); // UWP } void OnWarnLogMessage(BaseEvent evt) { string message = (string)evt.Params["message"]; Console.WriteLine("[SFS2X WARN] " + message); // .Net / Unity System.Diagnostics.Debug.WriteLine("[SFS2X WARN] " + message); // UWP }