aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Program.cs
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-09-06 22:12:09 -0500
committerJP Dillingham <jpdillingham@gmail.com>2021-09-06 22:12:09 -0500
commitedf86bfb54d31c1a0b02e7d416806d260dd5b7f2 (patch)
treef5d1f0bba74838e248fdbbd048f22d39ea1c1541 /src/slskd/Program.cs
parent4ece47620571f9f1aece0f68ab560770c2f77c0f (diff)
downloadslskd-edf86bfb54d31c1a0b02e7d416806d260dd5b7f2.tar.gz
add Program.IsCanary, silence noisy logs
Diffstat (limited to 'src/slskd/Program.cs')
-rw-r--r--src/slskd/Program.cs18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index 4489487a..ab14ab9e 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -114,6 +114,21 @@ namespace slskd
/// </summary>
public static string Version { get; } = $"{AssemblyVersion} ({InformationalVersion})";
+ /// <summary>
+ /// Gets a value indicating whether the current version is a Canary build.
+ /// </summary>
+ public static bool IsCanary { get; } = InformationalVersion.EndsWith("65534");
+
+ /// <summary>
+ /// Gets the API url for the application repository.
+ /// </summary>
+ public static string RepositoryAPIUrl { get; } = "https://api.github.com/repos/slskd/slskd";
+
+ /// <summary>
+ /// Gets the API url for the latest application release.
+ /// </summary>
+ public static string RepositoryAPILatestReleaseUrl { get; } = $"{RepositoryAPIUrl}/releases/latest";
+
private static IConfigurationRoot Configuration { get; set; }
private static OptionsAtStartup OptionsAtStartup { get; } = new OptionsAtStartup();
@@ -209,7 +224,8 @@ namespace slskd
Log.Logger = (OptionsAtStartup.Debug ? new LoggerConfiguration().MinimumLevel.Debug() : new LoggerConfiguration().MinimumLevel.Information())
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
- .MinimumLevel.Override("slskd.API.Authentication.PassthroughAuthenticationHandler", LogEventLevel.Information)
+ .MinimumLevel.Override("System.Net.Http.HttpClient", OptionsAtStartup.Debug ? LogEventLevel.Warning : LogEventLevel.Fatal)
+ .MinimumLevel.Override("slskd.Authentication.PassthroughAuthenticationHandler", LogEventLevel.Warning)
.Enrich.WithProperty("Version", Version)
.Enrich.WithProperty("InstanceName", OptionsAtStartup.InstanceName)
.Enrich.WithProperty("InvocationId", InvocationId)