Example #1
0
        public void Log(LogLevel level, string message)
        {
            //Event
            LoggerEventArgs e = new LoggerEventArgs(this, level, message);
            Server.PluginManager.CallEvent(Event.LOGGER_LOG, e);
            if (e.EventCanceled) return;
            level = e.LogLevel;
            message = e.LogMessage;
            //End Event

            LogToConsole(level, message);
            LogToFile(level, message);
        }
Example #2
0
        public void Log(Exception ex)
        {
            //Event
            LoggerEventArgs e = new LoggerEventArgs(this, LogLevel.Debug, ex.ToString(), ex);
            Server.PluginManager.CallEvent(Event.LOGGER_LOG, e);
            if (e.EventCanceled) return;
            //End Event

            Log(LogLevel.Debug, ex.ToString());
        }
Example #3
0
 private void OnLog(LoggerEventArgs e)
 {
     foreach (EventListener el in Plugins)
     {
         ServerListener sl = (ServerListener)el.Listener;
         if (el.Event == Event.LoggerLog)
             sl.OnLog(e);
     }
 }
Example #4
0
 public virtual void OnLog(LoggerEventArgs e)
 {
 }
Example #5
0
        public void Log(LogLevel level, string message)
        {
            //Event
            LoggerEventArgs e = new LoggerEventArgs(this, level, message);
            Server.PluginManager.CallEvent(Event.LoggerLog, e);
            // do not allow cancellation or altering of log messages
            //End Event

            LogToConsole(level, message);
            LogToFile(level, message);
        }
Example #6
0
        public void Log(Exception ex)
        {
            //Event
            LoggerEventArgs e = new LoggerEventArgs(this, LogLevel.Debug, ex.ToString(), ex);
            Server.PluginManager.CallEvent(Event.LoggerLog, e);
            // do not allow cancellation or altering of log messages
            //End Event

            Log(LogLevel.Debug, ex.ToString());
        }