mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Make preloader logger respect the log level
This commit is contained in:
1 parent
dfba4f0a03
commit
4b844b4dab
1 file changed
+9
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using BepInEx.Configuration;
|
||||
using BepInEx.Logging;
|
||||
|
||||
namespace BepInEx.Preloader
|
||||
@@ -29,6 +30,9 @@ namespace BepInEx.Preloader
|
||||
|
||||
public void LogEvent(object sender, LogEventArgs eventArgs)
|
||||
{
|
||||
if ((eventArgs.Level & ConfigConsoleDisplayedLevel.Value) == 0)
|
||||
return;
|
||||
|
||||
LogEvents.Add(eventArgs);
|
||||
|
||||
ConsoleManager.SetConsoleColor(eventArgs.Level.GetConsoleColor());
|
||||
@@ -56,6 +60,11 @@ namespace BepInEx.Preloader
|
||||
LoggerSource = null;
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly ConfigEntry<LogLevel> ConfigConsoleDisplayedLevel = ConfigFile.CoreConfig.Bind(
|
||||
"Logging.Console","LogLevels",
|
||||
LogLevel.Fatal | LogLevel.Error | LogLevel.Message | LogLevel.Info,
|
||||
"Which log levels to show in the console output.");
|
||||
}
|
||||
|
||||
public class PreloaderConsoleSource : TextWriter, ILogSource
|
||||
|
||||
Reference in new issue
Block a user