further fixes

This commit is contained in:
rootdarkarchon
2023-02-20 10:25:32 +01:00
parent b2b42b40c4
commit e461c6d5c9
9 changed files with 85 additions and 39 deletions

View File

@@ -20,13 +20,13 @@ internal class DalamudLogger : ILogger
{
if (!IsEnabled(logLevel)) return;
if (exception == null)
if ((int)logLevel <= (int)LogLevel.Information)
PluginLog.Information($"[{_name}]{{{(int)logLevel}}} {state}");
else
{
StringBuilder sb = new();
sb.AppendLine($"[{_name}]{{{(int)logLevel}}} {state}: {exception.Message}");
sb.AppendLine(exception.StackTrace);
sb.AppendLine($"[{_name}]{{{(int)logLevel}}} {state}: {exception?.Message}");
sb.AppendLine(exception?.StackTrace);
if (logLevel == LogLevel.Warning)
PluginLog.Warning(sb.ToString());
else if (logLevel == LogLevel.Error)