public static void StopFileLogThread() { FileLogQueue.CompleteAdding(); FileLoggingThread.Join(500); FileLoggingThread.Abort(); _fileLogEnabled = false; }
public static void LogErrors(Object[] errors) { if (_fileLogEnabled) { FileLogQueue.Add(new Tuple <object, string, bool>(errors, _errorLogPath, true)); } }
public static void LogErrorSecondary(Object[] errors, bool displayToScreen = false) { if (_fileLogEnabled) { FileLogQueue.Add(new Tuple <object, string, bool>(errors, _secondaryErrorLogPath, displayToScreen)); } }
public static void DebugLogToFileAsync(Object[] objects, string filename, bool displayToScreen = false) { if (_fileLogEnabled) { FileLogQueue.Add(new Tuple <object, string, bool>(objects, filename, displayToScreen)); } }
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); } } }