aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-06-06 21:38:26 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-06-06 21:38:26 -0500
commit1e477e18894999de2f2f39cde8336b31851fb242 (patch)
tree07ae00c75acd243f1d0d47ded687c417361fd6f2 /src
parentbf5d35a75d676f9004dfe6da4d3ca8a2b532a4f6 (diff)
downloadslskd-1e477e18894999de2f2f39cde8336b31851fb242.tar.gz
suppress logging of distributed messages if option is unset
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Application.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index 0144daa2..3e30c029 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -366,7 +366,14 @@ namespace slskd
_ => default,
};
- var logger = Loggers.GetOrAdd(sender.GetType().FullName, Log.ForContext("Context", "Soulseek").ForContext("SubContext", sender.GetType().FullName));
+ var source = sender.GetType().FullName;
+
+ if (source.EndsWith("DistributedConnectionManager") && !Options.Soulseek.DistributedNetwork.Logging)
+ {
+ return;
+ }
+
+ var logger = Loggers.GetOrAdd(source, Log.ForContext("Context", "Soulseek").ForContext("SubContext", source));
logger.Write(TranslateLogLevel(args.Level), "{@Message}", args.Message);
}