//... public Log methods private static void Log(LogRecord loggingRecord) { try { lock (_staticSyncRoot) { if (LoggingEnabled) { if (IsAsynchroneous) { _loggingThread.AddWork(loggingRecord); } else { if (LogWriter != null) { LogWriter.Write(loggingRecord); LogWriter.Flush(); } } } } } catch (Exception ex) { FallbackLogging(loggingRecord, ex); } }
public static void FallbackLogging(LogRecord loggingRecord, Exception ex) { try { if (ex != null) { Debug.WriteLine("Logging failure : " + ex.ToString()); } } catch { } }
private static void WhenLogHandlerDo(LogRecord record) { if (LogWriter != null) LogWriter.Write(record); }
public LogRecord Extend() { var extension = new LogRecord(); extension.Identifier = this.Identifier; return extension; }