mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
4 files changed
+12
-7
No files matched your search
@@ -4,10 +4,17 @@ using BepInEx.Logging;
|
||||
|
||||
namespace BepInEx.Preloader.Core.Logging
|
||||
{
|
||||
/// <summary>
|
||||
/// Log listener that listens to logs during preloading time and buffers messages for output in Unity logs later.
|
||||
/// </summary>
|
||||
public class PreloaderConsoleListener : ILogListener
|
||||
{
|
||||
/// <summary>
|
||||
/// A list of all <see cref="LogEventArgs"/> objects that this listener has received.
|
||||
/// </summary>
|
||||
public static List<LogEventArgs> LogEvents { get; } = new List<LogEventArgs>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public void LogEvent(object sender, LogEventArgs eventArgs)
|
||||
{
|
||||
if ((eventArgs.Level & ConfigConsoleDisplayedLevel.Value) == 0)
|
||||
@@ -21,6 +28,7 @@ namespace BepInEx.Preloader.Core.Logging
|
||||
LogLevel.Fatal | LogLevel.Error | LogLevel.Warning | LogLevel.Message | LogLevel.Info,
|
||||
"Which log levels to show in the console output.");
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose() { }
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,6 @@ namespace BepInEx.Preloader.Core
|
||||
/// Adds all patchers from all managed assemblies specified in a directory.
|
||||
/// </summary>
|
||||
/// <param name="directory">Directory to search patcher DLLs from.</param>
|
||||
/// <param name="patcherLocator">A function that locates assembly patchers in a given managed assembly.</param>
|
||||
public void AddPatchersFromDirectory(string directory)
|
||||
{
|
||||
if (!Directory.Exists(directory))
|
||||
@@ -252,7 +251,7 @@ namespace BepInEx.Preloader.Core
|
||||
{
|
||||
return new AssemblyName(fullName).Name;
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
return fullName;
|
||||
}
|
||||
|
||||
@@ -35,11 +35,13 @@ namespace BepInEx.Preloader.Core
|
||||
/// </summary>
|
||||
public string TypeName { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Save(BinaryWriter bw)
|
||||
{
|
||||
bw.Write(TypeName);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Load(BinaryReader br)
|
||||
{
|
||||
TypeName = br.ReadString();
|
||||
|
||||
@@ -57,11 +57,7 @@ namespace BepInEx.Preloader.Unity
|
||||
/// <summary>
|
||||
/// The main entrypoint of BepInEx, called from Doorstop.
|
||||
/// </summary>
|
||||
/// <param name="args">
|
||||
/// The arguments passed in from Doorstop. First argument is the path of the currently executing
|
||||
/// process.
|
||||
/// </param>
|
||||
public static void Main(string[] args)
|
||||
public static void Main()
|
||||
{
|
||||
// We set it to the current directory first as a fallback, but try to use the same location as the .exe file.
|
||||
string silentExceptionLog = $"preloader_{DateTime.Now:yyyyMMdd_HHmmss_fff}.log";
|
||||
|
||||
Reference in new issue
Block a user