mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 21:37:22 +01:00
add performance logging on demand, fix minion issues
This commit is contained in:
parent
6cf0ecdef1
commit
44450b24b4
29 changed files with 580 additions and 294 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using Dalamud.Logging;
|
||||
using MareSynchronos.MareConfiguration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Text;
|
||||
|
||||
namespace MareSynchronos.Utils;
|
||||
|
||||
|
|
@ -20,13 +21,19 @@ internal class DalamudLogger : ILogger
|
|||
if (!IsEnabled(logLevel)) return;
|
||||
|
||||
if (exception == null)
|
||||
PluginLog.Information($"[{_name}]{{{(int)logLevel}}} {formatter(state, exception)}");
|
||||
else if (logLevel == LogLevel.Warning)
|
||||
PluginLog.Warning($"[{_name}]{{{(int)logLevel}}} {formatter(state, exception)}");
|
||||
else if (logLevel == LogLevel.Error)
|
||||
PluginLog.Error($"[{_name}]{{{(int)logLevel}}} {formatter(state, exception)}");
|
||||
PluginLog.Information($"[{_name}]{{{(int)logLevel}}} {state}");
|
||||
else
|
||||
PluginLog.Fatal($"[{_name}]{{{(int)logLevel}}} {formatter(state, exception)}");
|
||||
{
|
||||
StringBuilder sb = new();
|
||||
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)
|
||||
PluginLog.Error(sb.ToString());
|
||||
else
|
||||
PluginLog.Fatal(sb.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsEnabled(LogLevel logLevel)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue