From 18cd187fc4d1cd0eacc77ad5290ae060c08263ff Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Tue, 5 Oct 2021 08:25:45 -0500 Subject: bind the LogEmitted event to the hub --- src/slskd/Application.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs index dfdd2d78..b6d29d6b 100644 --- a/src/slskd/Application.cs +++ b/src/slskd/Application.cs @@ -64,7 +64,8 @@ namespace slskd IRoomService roomService, ISharedFileCache sharedFileCache, IPushbulletService pushbulletService, - IHubContext applicationHub) + IHubContext applicationHub, + IHubContext logHub) { OptionsAtStartup = optionsAtStartup; @@ -87,6 +88,9 @@ namespace slskd RoomService = roomService; ApplicationHub = applicationHub; + LogHub = logHub; + Program.LogEmitted += (_, log) => LogHub.EmitLogAsync(log); + Client = soulseekClient; Client.DiagnosticGenerated += Client_DiagnosticGenerated; @@ -128,6 +132,7 @@ namespace slskd private IManagedState State { get; } private ITransferTracker TransferTracker { get; set; } private IHubContext ApplicationHub { get; set; } + private IHubContext LogHub { get; set; } /// /// Gets the version of the latest application release. -- cgit v1.2.3