mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Fix BepInExLogger not logging exceptions
This commit is contained in:
1 parent
0bc9578e75
commit
c184450015
1 file changed
+10
-2
@@ -37,10 +37,18 @@ internal class BepInExLoggerProvider : ILoggerProvider
|
||||
EventId eventId,
|
||||
TState state,
|
||||
Exception exception,
|
||||
Func<TState, Exception, string> formatter) =>
|
||||
Func<TState, Exception, string> formatter)
|
||||
{
|
||||
var logLine = state.ToString() ?? string.Empty;
|
||||
|
||||
if (exception != null)
|
||||
logLine += $"\nException: {exception}";
|
||||
|
||||
LogEvent?.Invoke(this,
|
||||
new LogEventArgs(formatter(state, exception), MSLogLevelToBepInExLogLevel(logLevel),
|
||||
new LogEventArgs(logLine, MSLogLevelToBepInExLogLevel(logLevel),
|
||||
this));
|
||||
}
|
||||
|
||||
|
||||
public bool IsEnabled(LogLevel logLevel) =>
|
||||
(MSLogLevelToBepInExLogLevel(logLevel) & Logger.ListenedLogLevels) != BepInExLogLevel.None;
|
||||
|
||||
Reference in new issue
Block a user