using System.Collections.Generic; using BepInEx.Configuration; using BepInEx.Logging; namespace BepInEx.Preloader { /// /// Log listener that listens to logs during preloading time and buffers messages for output in Unity logs later. /// public class PreloaderConsoleListener : ILogListener { /// /// /// public static List LogEvents { get; } = new List(); /// public void LogEvent(object sender, LogEventArgs eventArgs) { if ((eventArgs.Level & ConfigConsoleDisplayedLevel.Value) == 0) return; LogEvents.Add(eventArgs); } private static readonly ConfigEntry ConfigConsoleDisplayedLevel = ConfigFile.CoreConfig.Bind( "Logging.Console","LogLevels", LogLevel.Fatal | LogLevel.Error | LogLevel.Message | LogLevel.Info | LogLevel.Warning, "Which log levels to show in the console output."); /// public void Dispose() { } } }