aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2023-01-07 16:14:15 -0600
committerJP Dillingham <jp@dillingham.me>2023-01-07 16:14:15 -0600
commitf734a9a8cce50e4ed638274758dd1ff0f99e14e7 (patch)
tree3da54e7dae27db4957f392e66168ff68008c450e /src
parent87f72f7f482953c90ed50eca647f36827cdd64cd (diff)
downloadslskd-f734a9a8cce50e4ed638274758dd1ff0f99e14e7.tar.gz
polish logging
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Relay/RelayService.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/slskd/Relay/RelayService.cs b/src/slskd/Relay/RelayService.cs
index 47879b19..1dda50c2 100644
--- a/src/slskd/Relay/RelayService.cs
+++ b/src/slskd/Relay/RelayService.cs
@@ -456,7 +456,7 @@ namespace slskd.Relay
var key = new WaitKey(nameof(GetFileInfoAsync), agentName, id);
var wait = Waiter.Wait<(bool Exists, long Length)>(key, timeout);
- Log.Information("Created wait {Key}", key);
+ Log.Debug("Created wait {Key}", key);
try
{
@@ -624,6 +624,8 @@ namespace slskd.Relay
/// <returns>The operation context.</returns>
public Task HandleShareUpload(string agentName, Guid id, IEnumerable<Share> shares, string filename)
{
+ Log.Information("Loading shares from agent {Agent}", agentName);
+
using var repository = ShareRepositoryFactory.CreateFromFile(filename);
if (!repository.TryValidate(out var problems))
@@ -637,6 +639,8 @@ namespace slskd.Relay
Shares.AddOrUpdateHost(new Host(agentName, shares));
+ Log.Information("Shares from agent {Agent} ready.", agentName);
+
return Task.CompletedTask;
}
@@ -694,8 +698,12 @@ namespace slskd.Relay
if (TryGetAgentRegistration(connectionId, out var found))
{
+ Log.Information("Unloading shares for agent {Agent}", found.Agent.Name);
+
Shares.TryRemoveHost(found.Agent.Name);
removed = RegisteredAgentDictionary.TryRemove(found.Agent.Name, out record);
+
+ Log.Information("Shares for agent {Agent} unloaded", found.Agent.Name);
}
State.SetValue(state => state with { Agents = RegisteredAgents });