Browse Source

Fix preloader log not displaying

Bepis 6 years ago
parent
commit
b024c7e2a3
1 changed files with 4 additions and 1 deletions
  1. 4 1
      BepInEx/Bootstrap/Preloader.cs

+ 4 - 1
BepInEx/Bootstrap/Preloader.cs

@@ -58,6 +58,7 @@ namespace BepInEx.Bootstrap
             try
             try
             {
             {
                 PreloaderLog = new PreloaderLogWriter();
                 PreloaderLog = new PreloaderLogWriter();
+                PreloaderLog.Enabled = true;
 
 
                 PreloaderLog.WriteLine($"BepInEx {Assembly.GetExecutingAssembly().GetName().Version}");
                 PreloaderLog.WriteLine($"BepInEx {Assembly.GetExecutingAssembly().GetName().Version}");
                 PreloaderLog.Log(LogLevel.Message, "Preloader started");
                 PreloaderLog.Log(LogLevel.Message, "Preloader started");
@@ -104,11 +105,13 @@ namespace BepInEx.Bootstrap
                 {
                 {
                     File.WriteAllText(Path.Combine(GameRootPath, $"preloader_{DateTime.Now:yyyyMMdd_HHmmss_fff}.log"),
                     File.WriteAllText(Path.Combine(GameRootPath, $"preloader_{DateTime.Now:yyyyMMdd_HHmmss_fff}.log"),
                         PreloaderLog.ToString());
                         PreloaderLog.ToString());
+
+                    PreloaderLog.Dispose();
                 }
                 }
             }
             }
             finally
             finally
             {
             {
-                PreloaderLog.Disable();
+                PreloaderLog.Enabled = false;
             }
             }
         }
         }