Compare commits
1 Commits
v1.0.30-ma
...
v1.0.31-ma
Author | SHA1 | Date | |
---|---|---|---|
![]() |
cf75210304 |
@@ -63,7 +63,8 @@ namespace Torch.Server
|
||||
File.Move(oldTorchCfg, torchCfg, true);
|
||||
|
||||
Target.Register<LogViewerTarget>(nameof(LogViewerTarget));
|
||||
LogManager.Configuration = new XmlLoggingConfiguration(newNlog);
|
||||
TorchLogManager.Configuration = new XmlLoggingConfiguration(newNlog);
|
||||
LogManager.Configuration = TorchLogManager.Configuration;
|
||||
LogManager.ReconfigExistingLoggers();
|
||||
|
||||
var config = Persistent<TorchConfig>.Load(torchCfg);
|
||||
|
@@ -5,6 +5,7 @@ using System.Runtime.CompilerServices;
|
||||
using NLog;
|
||||
using NLog.Config;
|
||||
using Torch.Managers.PatchManager;
|
||||
using Torch.Utils;
|
||||
|
||||
namespace Torch.Patches
|
||||
{
|
||||
@@ -36,16 +37,14 @@ namespace Torch.Patches
|
||||
_log.Warn("GALogger constructor is unknown. Logging may not function.");
|
||||
return;
|
||||
}
|
||||
ctx.GetPattern(ctor).Prefixes.Add(typeof(GameAnalyticsPatch).GetMethod(nameof(PatchLogger),
|
||||
BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public));
|
||||
ctx.GetPattern(ctor).AddPrefix(nameof(PatchLogger));
|
||||
}
|
||||
|
||||
private static void FixLogging()
|
||||
{
|
||||
_setLogger(null, LogManager.GetLogger("GameAnalytics"));
|
||||
if (!(LogManager.Configuration is XmlLoggingConfiguration))
|
||||
LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(
|
||||
Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) ?? Environment.CurrentDirectory, "NLog.config"));
|
||||
if (LogManager.Configuration is not XmlLoggingConfiguration)
|
||||
LogManager.Configuration = TorchLogManager.Configuration;
|
||||
}
|
||||
|
||||
private static bool PatchLogger()
|
||||
|
8
Torch/Utils/TorchLogManager.cs
Normal file
8
Torch/Utils/TorchLogManager.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using NLog.Config;
|
||||
|
||||
namespace Torch.Utils;
|
||||
|
||||
public static class TorchLogManager
|
||||
{
|
||||
public static LoggingConfiguration Configuration { get; set; }
|
||||
}
|
Reference in New Issue
Block a user