Skip to content

Commit

Permalink
improvements to logging
Browse files Browse the repository at this point in the history
  • Loading branch information
aaart committed Oct 24, 2024
1 parent 63646d7 commit 7c9eaee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protected override Task<IEnumerable<SatelTask>> Handle(ActualStateAlarmIOPostRea

if (data.Changes.Any())
{
Logger.LogInformation($"{data.Changes.Count} changes found. {data.OutgoingEventType} event will be send.");
Logger.LogInformation($"{data.Changes.Count} change(s) found. {data.OutgoingEventType} event will be send.");
var t1 = new PersistedStateUpdateTask(data.PersistedStateKey, data.ActualState);
var t2 = new ActualStateChangedNotificationTask(data.Changes, data.OutgoingEventType);
tasks.Add(t1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ protected override Task<IEnumerable<SatelTask>> Handle(ActualStateBinaryIOPostRe
{
if (data.Changes.Any())
{
Logger.LogInformation($"{data.Changes.Count} changes found. {data.OutgoingEventType} event will be send.");
Logger.LogInformation($"{data.Changes.Count} change(s) found. {data.OutgoingEventType} event will be send.");
var t1 = new PersistedStateUpdateTask(data.PersistedStateKey, data.ActualState);
var t2 = new ActualStateChangedNotificationTask(data.Changes, data.OutgoingEventType);
return Task.FromResult(new SatelTask[] { t1, t2 }.AsEnumerable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ public ActualStateChangedNotificationTaskHandler(IOutgoingEventPublisher eventPu

protected override async Task<IEnumerable<SatelTask>> Handle(ActualStateChangedNotificationTask data)
{
Logger.LogInformation($"Outgoing event type is {data.OutgoingEventType.ToString()}");
foreach (var state in data.Notifications)
{
Logger.LogInformation($"index: {state.Index}, value: {state.Value}");
Logger.LogInformation($"Outgoing event type is {data.OutgoingEventType.ToString()}. index: {state.Index}, value: {state.Value}");
await _eventPublisher.PublishAsync(new OutgoingEvent(data.OutgoingEventType, state.Index, state.Value));
}

Expand Down

0 comments on commit 7c9eaee

Please sign in to comment.