/// <summary> /// </summary> /// <param name="severity"></param> /// <param name="entry"></param> /// <param name="formatParameters"></param> public virtual void Log(LoggerSeverity severity, object entry, params object[] formatParameters) { try { // Get the current timestamp DateTime timestamp = m_timestampProvider.Now; TimeSpan?utcOffset = m_timestampProvider.UtcOffset; // Check all the filters if (m_filters != null) { foreach (ILogFilter filter in m_filters) { if (!filter.IsLoggable(m_threshold, severity, timestamp, entry, formatParameters)) { return; } } } string logLine = null; if (m_formatter == null) { if (entry != null) { logLine = entry.ToString(); } } else { logLine = Formatter.FormatEntry(severity, timestamp, utcOffset, entry, formatParameters, m_category, m_data); } DoLog(severity, timestamp, entry, formatParameters, logLine); } #if DEBUG catch (Exception ex) { Console.WriteLine(ExceptionUtilities.GetHumanReadableExceptionDetailsAsString(ex)); } #else catch (Exception) { } #endif }