Exemple #1
0
 public static void StopFileLogThread()
 {
     FileLogQueue.CompleteAdding();
     FileLoggingThread.Join(500);
     FileLoggingThread.Abort();
     _fileLogEnabled = false;
 }
Exemple #2
0
 public static void LogErrors(Object[] errors)
 {
     if (_fileLogEnabled)
     {
         FileLogQueue.Add(new Tuple <object, string, bool>(errors, _errorLogPath, true));
     }
 }
Exemple #3
0
 public static void LogErrorSecondary(Object[] errors, bool displayToScreen = false)
 {
     if (_fileLogEnabled)
     {
         FileLogQueue.Add(new Tuple <object, string, bool>(errors, _secondaryErrorLogPath, displayToScreen));
     }
 }
Exemple #4
0
 public static void DebugLogToFileAsync(Object[] objects, string filename, bool displayToScreen = false)
 {
     if (_fileLogEnabled)
     {
         FileLogQueue.Add(new Tuple <object, string, bool>(objects, filename, displayToScreen));
     }
 }
Exemple #5
0
        private static void ProcessFileLogItem()
        {
            foreach (var item in FileLogQueue.GetConsumingEnumerable())
            {
                Object thing           = item.Item1;
                string filename        = item.Item2;
                bool   displayOnScreen = item.Item3;

                if (thing is object[])
                {
                    LogErrorsToFile(thing as object[], filename, displayOnScreen);
                }
                else
                {
                    LogErrorToFile(thing, filename, displayOnScreen);
                }
            }
        }