aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Application.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-10-05 09:27:54 -0500
committerGitHub <noreply@github.com>2021-10-05 09:27:54 -0500
commit228cd7f97761137bde191d45c1771879a8d45de3 (patch)
tree814080998abb27aa0edf07585b9833c5c56c4535 /src/slskd/Application.cs
parent1c790a33ba51598e5d5e9da77cf294c601e702be (diff)
parent869bbac175c9ee55a6e0ed4c30237ec969e48dc0 (diff)
downloadslskd-228cd7f97761137bde191d45c1771879a8d45de3.tar.gz
Merge pull request #208 from slskd/buffer-logs
Buffer application logs and make them available via a REST API and SignalR hub
Diffstat (limited to 'src/slskd/Application.cs')
-rw-r--r--src/slskd/Application.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index dfdd2d78..1027d7f3 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> applicationHub)
+ IHubContext<ApplicationHub> applicationHub,
+ IHubContext<LogsHub> 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> State { get; }
private ITransferTracker TransferTracker { get; set; }
private IHubContext<ApplicationHub> ApplicationHub { get; set; }
+ private IHubContext<LogsHub> LogHub { get; set; }
/// <summary>
/// Gets the version of the latest application release.