2025-12-11 15:26:27 +11:00
|
|
|
|
using Microsoft.AspNetCore.SignalR;
|
2023-04-13 17:43:26 -05:00
|
|
|
|
|
2024-08-04 18:44:33 -05:00
|
|
|
|
namespace LANCommander.Server.Hubs
|
2023-04-13 17:43:26 -05:00
|
|
|
|
{
|
2024-01-29 22:29:47 -06:00
|
|
|
|
public class LoggingHub : Hub
|
2023-04-13 17:43:26 -05:00
|
|
|
|
{
|
2025-02-08 19:32:16 -06:00
|
|
|
|
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);
|
2025-02-08 19:32:16 -06:00
|
|
|
|
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)
|
2023-04-13 17:43:26 -05:00
|
|
|
|
{
|
2025-12-11 15:26:27 +11:00
|
|
|
|
await context.Clients.All.SendAsync("Log", message, logLevel, timestamp);
|
2023-04-13 17:43:26 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-08-29 00:19:56 -05:00
|
|
|
|
}
|