public static Dictionary <string, string> ToDictionary(this ILoggerProperties properties) { if (properties == null) { return(null); } var newDict = new Dictionary <string, string>(); var typen = properties.GetType(); foreach (var propInfo in typen.GetProperties()) { var propValue = propInfo.GetValue(properties, null); var dictionaryValue = propValue?.ToString() ?? null; newDict.Add(propInfo.Name, dictionaryValue); } return(newDict); }
public void Debug(string text, ILoggerProperties properties = null) { Console.Out.WriteLine(text); }
public void CustomEvent(string text, ILoggerProperties properties = null) { Console.Out.WriteLine(text); }
public void Fatal(string text, Exception ex, ILoggerProperties properties = null) { Console.Error.WriteLine($"{text}\n{ex}"); }
public void Fatal(string text, ILoggerProperties properties = null) { Console.Error.WriteLine(text); }
public void Warn(string text, Exception ex, ILoggerProperties properties = null) { Console.Out.WriteLine($"{text}\n{ex}"); }
public void CustomEvent(string text, ILoggerProperties properties = null) { _telemetryClient.TrackEvent(text, properties.ToDictionary()); _telemetryClient.Flush(); }
public void Fatal(string text, Exception ex, ILoggerProperties properties = null) { _telemetryClient.TrackTrace($"{text}\n{ex}", SeverityLevel.Critical, properties.ToDictionary()); _telemetryClient.TrackException(ex, properties.ToDictionary()); _telemetryClient.Flush(); }
public void Fatal(string text, ILoggerProperties properties = null) { _telemetryClient.TrackTrace(text, SeverityLevel.Critical, properties.ToDictionary()); _telemetryClient.Flush(); }
public void Info(string text, ILoggerProperties properties = null) { _telemetryClient.TrackTrace(text, SeverityLevel.Information, properties.ToDictionary()); _telemetryClient.Flush(); }
public void Debug(string text, ILoggerProperties properties = null) { _telemetryClient.TrackTrace(text, SeverityLevel.Verbose, properties.ToDictionary()); }
public void Fatal(string text, Exception ex, ILoggerProperties properties = null) { _loggers.ForEach(p => p.Fatal(text, ex, properties)); }
public void Error(string text, ILoggerProperties properties = null) { _loggers.ForEach(p => p.Error(text, properties)); }
public void Warn(string text, ILoggerProperties properties = null) { _loggers.ForEach(p => p.Warn(text, properties)); }
public void Debug(string text, ILoggerProperties properties = null) { _loggers.ForEach(p => p.Debug(text, properties)); }
public void Info(string text, ILoggerProperties properties = null) { _loggers.ForEach(p => p.Info(text, properties)); }