LANCommander/LANCommander.Server/Hubs/LoggingHub.cs

18 lines
601 B
C#
Raw Permalink Normal View History

2025-12-11 15:26:27 +11:00
using Microsoft.AspNetCore.SignalR;
2024-08-04 18:44:33 -05:00
namespace LANCommander.Server.Hubs
{
public class LoggingHub : Hub
{
public override async Task OnConnectedAsync()
{
2025-12-11 15:26:27 +11:00
await Clients.Caller.SendAsync("Log", "Connected to server logging provider!", LogLevel.Information, DateTime.Now);
await base.OnConnectedAsync();
}
2025-12-11 15:26:27 +11:00
public static async Task Log(IHubContext<LoggingHub> context, string message, LogLevel logLevel, DateTime timestamp)
{
2025-12-11 15:26:27 +11:00
await context.Clients.All.SendAsync("Log", message, logLevel, timestamp);
}
}
2024-08-29 00:19:56 -05:00
}