public void LogError(LocalChannel channel, LocalChannelError error, string errorText, string additionalData = "") { var entry = new LocalChannelLogEntry { Timestamp = DateTime.Now, EntryType = LocalChannelLogEntryType.Error, ChannelId = channel != null && channel.Id != 0 ? channel.Id : (int?)null, TemporaryChannelId = channel?.TemporaryChannelId, ChannelData = channel?.ToString(), State = channel?.State, Error = error, ErrorText = errorText, DebugData = GetDebugData(), AdditionalData = additionalData }; string channelData = channel != null?channel.ToString() : ""; _logger.LogError($"{error}: {errorText}. AdditionalData: {additionalData}. Channel: {channelData}"); Save(entry); }
public void LogPendingChannelError(string temporaryChannelId, LocalChannelState state, LocalChannelError error, string errorText) { var entry = new LocalChannelLogEntry { Timestamp = DateTime.Now, EntryType = LocalChannelLogEntryType.Error, TemporaryChannelId = temporaryChannelId, State = state, Error = error, ErrorText = errorText, DebugData = GetDebugData() }; _logger.LogError($"{error}: {errorText}. TemporaryChannelID: {temporaryChannelId}"); Save(entry); }