public static void LogTo(DataHeader header, string fileName, params object[] values) { try { var filter = LogFilter; // Capture var mask = TopicMask; // Capture if ( (filter == null || filter(header, values)) && (mask == null || mask.IsMatch(header.Topic)) ) { var handler = LogData; // Capture if (handler != null) { handler(header, fileName, values); } } } catch (Exception e) { System.Diagnostics.Debug.WriteLine("Error attempting to log data: \r\n" + e.ToString()); // Don't rethrow } }
public static void Log(DataHeader header, params object[] values) { LogTo(header, null, values); }