Loggerrework (#45)

* test some refactoring for cachedplayer

* rework logging

* fix saving of log level

---------

Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
rootdarkarchon
2023-02-18 15:23:38 +01:00
committed by GitHub
parent 7f36e80e2a
commit 2ae5d42e4d
49 changed files with 676 additions and 691 deletions

View File

@@ -1,6 +1,6 @@
using Dalamud.Plugin;
using MareSynchronos.MareConfiguration.Configurations;
using MareSynchronos.Utils;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
namespace MareSynchronos.MareConfiguration;
@@ -44,7 +44,7 @@ public abstract class ConfigurationServiceBase<T> : IDisposable where T : IMareC
var lastWriteTime = GetConfigLastWriteTime();
if (lastWriteTime != _configLastWriteTime)
{
Logger.Debug($"Config {ConfigurationName} changed, reloading config");
//_logger.LogDebug($"Config {ConfigurationName} changed, reloading config");
_currentConfigInternal = LazyConfig();
}
}
@@ -98,7 +98,7 @@ public abstract class ConfigurationServiceBase<T> : IDisposable where T : IMareC
}
}
Logger.Debug("Saving dirty config " + ConfigurationName);
//_logger.LogDebug("Saving dirty config " + ConfigurationName);
try
{
@@ -117,7 +117,7 @@ public abstract class ConfigurationServiceBase<T> : IDisposable where T : IMareC
public void Dispose()
{
Logger.Verbose($"Disposing {GetType()}");
//_logger.LogTrace($"Disposing {GetType()}");
_periodicCheckCts.Cancel();
}
}