Update Hub to .NET 8 and all OpenTelemetry

This commit is contained in:
2024-01-27 16:25:14 -05:00
parent d8fd6d13f9
commit 9cddb80f00
12 changed files with 78 additions and 125 deletions

View File

@@ -1,17 +1,17 @@
using JetBrains.Annotations;
using Microsoft.AspNetCore.SignalR;
using System;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
namespace ChrisKaczor.HomeMonitor.Hub.Service.Hubs
{
[UsedImplicitly]
public class DeviceStatusHub : Microsoft.AspNetCore.SignalR.Hub
public class DeviceStatusHub(ILogger<DeviceStatusHub> logger) : Microsoft.AspNetCore.SignalR.Hub
{
[UsedImplicitly]
public async Task RequestLatestStatus()
{
Console.WriteLine("RequestLatestStatus");
logger.LogInformation("RequestLatestStatus");
await Clients.Others.SendAsync("RequestLatestStatus");
}
@@ -19,7 +19,7 @@ namespace ChrisKaczor.HomeMonitor.Hub.Service.Hubs
[UsedImplicitly]
public async Task SendLatestStatus(string message)
{
Console.WriteLine($"LatestStatus: {message}");
logger.LogInformation($"LatestStatus: {message}");
await Clients.Others.SendAsync("LatestStatus", message);
}