Example #1
0
 private void processLog(LogEntry entry) {
     StreamWriter streamWriter = File.AppendText(Path.Combine(Environment.LogsDirectory, Environment.LogFile));
     streamWriter.WriteLine("[" + DateTime.Now + "] [" + entry.Severity.ToString() + "] " + entry.Message);
     streamWriter.Close();
     if (entry.RCON && R.Settings != null && R.Settings.Instance.RCON.Enabled)
     {
         RCONServer.Broadcast(entry.Message);
     }
 }
Example #2
0
        public void Enqueue(LogEntry le)
        {
            //lock during write
            lock (logEntryQueueLock)
            {
                logEntryQueue.Enqueue(le);

                //while locked check to see if the BW is running, if not start it
                if (!logger.IsBusy)
                    logger.RunWorkerAsync();
            }
        }