mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-02-15 02:48:32 -05:00
Add logging
This commit is contained in:
@@ -45,8 +45,13 @@ public class MessageHandler : IHostedService
|
|||||||
|
|
||||||
private async Task RequestLatestStatus()
|
private async Task RequestLatestStatus()
|
||||||
{
|
{
|
||||||
|
WriteLog("RequestLatestStatus");
|
||||||
|
|
||||||
foreach (var device in _deviceRepository.Values)
|
foreach (var device in _deviceRepository.Values)
|
||||||
|
{
|
||||||
|
WriteLog($"RequestLatestStatus: {device.Name}");
|
||||||
await SendDeviceStatus(device);
|
await SendDeviceStatus(device);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnInterceptingPublishAsync(InterceptingPublishEventArgs arg)
|
private async Task OnInterceptingPublishAsync(InterceptingPublishEventArgs arg)
|
||||||
|
|||||||
@@ -11,13 +11,15 @@ namespace ChrisKaczor.HomeMonitor.Hub.Service.Hubs
|
|||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public async Task RequestLatestStatus()
|
public async Task RequestLatestStatus()
|
||||||
{
|
{
|
||||||
|
Console.WriteLine("RequestLatestStatus");
|
||||||
|
|
||||||
await Clients.Others.SendAsync("RequestLatestStatus");
|
await Clients.Others.SendAsync("RequestLatestStatus");
|
||||||
}
|
}
|
||||||
|
|
||||||
[UsedImplicitly]
|
[UsedImplicitly]
|
||||||
public async Task SendLatestStatus(string message)
|
public async Task SendLatestStatus(string message)
|
||||||
{
|
{
|
||||||
Console.WriteLine(message);
|
Console.WriteLine($"LatestStatus: {message}");
|
||||||
|
|
||||||
await Clients.Others.SendAsync("LatestStatus", message);
|
await Clients.Others.SendAsync("LatestStatus", message);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user