public async void LogError(string userFriendlyMessage, string message, Exception ex = null) { if (!LoggingService._isEnabled) { return; } var newMsg = new LogMessage() { FriendlyMessage = userFriendlyMessage, Message = message, Exception = null, Type = 3 }; WriteMsg(newMsg); }
public static async void LogInformation(string userFriendlyMessage, string message) { if (!LoggingService._isEnabled) { return; } var newMsg = new LogMessage() { FriendlyMessage = userFriendlyMessage, Message = message, Exception = null, Type = 1 }; WriteMsg(newMsg); }
private static async void WriteMsg(LogMessage newMsg) { if (newMsg == null) return; await Task.Run(() => { newMsg.DateStamp = DateTime.UtcNow; if (_isSavingToDb) { _shadowLoggingMessages.Add(newMsg); } else { LoggingMessages.Add(newMsg); } Messenger.Default.Send<GeneralSystemWideMessage>(new GeneralSystemWideMessage("writing ...") { Identifier = "LB", SourceId = "WriteMsg" }); }); }