aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Program.cs
diff options
context:
space:
mode:
authorChristoffer Aske <exouxas@gmail.com>2021-10-07 19:57:30 +0200
committerChristoffer Aske <exouxas@gmail.com>2021-10-07 19:57:30 +0200
commit3868570c571a631773c065ddad470c8077a5869e (patch)
tree9b1971e06982fc900a1eb2e3d3a8f137b30108bb /src/slskd/Program.cs
parent7937590fd9791c4cf6fbe15ad716b823e53f58fb (diff)
downloadslskd-3868570c571a631773c065ddad470c8077a5869e.tar.gz
Moved directory verification to above the logger initialization
Diffstat (limited to 'src/slskd/Program.cs')
-rw-r--r--src/slskd/Program.cs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index a4ae699e..5690051b 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -212,6 +212,18 @@ namespace slskd
return;
}
+ try
+ {
+ VerifyDirectory(OptionsAtStartup.Directories.App, createIfMissing: true, verifyWriteable: true);
+ VerifyDirectory(OptionsAtStartup.Directories.Incomplete, createIfMissing: true, verifyWriteable: true);
+ VerifyDirectory(OptionsAtStartup.Directories.Downloads, createIfMissing: true, verifyWriteable: true);
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine($"Filesystem exception: {ex.Message}");
+ return;
+ }
+
Log.Logger = (OptionsAtStartup.Debug ? new LoggerConfiguration().MinimumLevel.Debug() : new LoggerConfiguration().MinimumLevel.Information())
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("System.Net.Http.HttpClient", OptionsAtStartup.Debug ? LogEventLevel.Warning : LogEventLevel.Fatal)
@@ -237,18 +249,6 @@ namespace slskd
var logger = Log.ForContext(typeof(Program));
- try
- {
- VerifyDirectory(OptionsAtStartup.Directories.App, createIfMissing: true, verifyWriteable: true);
- VerifyDirectory(OptionsAtStartup.Directories.Incomplete, createIfMissing: true, verifyWriteable: true);
- VerifyDirectory(OptionsAtStartup.Directories.Downloads, createIfMissing: true, verifyWriteable: true);
- }
- catch (Exception ex)
- {
- logger.Error(ex, "Filesystem exception: {Message}", ex.Message);
- return;
- }
-
if (!OptionsAtStartup.NoLogo)
{
PrintLogo(Version);