Skip to content

Commit e0a4ee9

Browse files
committed
Configure NLog
1 parent 15af769 commit e0a4ee9

5 files changed

Lines changed: 18 additions & 4 deletions

File tree

‎NLog.config‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4+
5+
<targets>
6+
<target name="logfile" layout="${longdate} [${level:uppercase=true}] ${message}" xsi:type="File" fileName="Torch.log" />
7+
<target name="console" layout="${longdate} [${level:uppercase=true}] ${message}" xsi:type="ColoredConsole" />
8+
</targets>
9+
10+
<rules>
11+
<logger name="*" minlevel="Info" writeTo="logfile" />
12+
<logger name="*" minlevel="Info" writeTo="console" />
13+
</rules>
14+
</nlog>

‎Torch/Managers/NetworkManager/NetworkManager.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public NetworkManager()
2020
InitNetworkIntercept();
2121
}
2222

23-
private static Logger _log = LogManager.GetCurrentClassLogger();
23+
private static Logger _log = LogManager.GetLogger("Torch");
2424
private static NetworkManager _instance;
2525
public static NetworkManager Instance => _instance ?? (_instance = new NetworkManager());
2626

‎Torch/MultiplayerManager.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class MultiplayerManager : IMultiplayer
4444
public Player LocalPlayer { get; private set; }
4545

4646
private readonly ITorchBase _torch;
47-
private static Logger _log = LogManager.GetCurrentClassLogger();
47+
private static Logger _log = LogManager.GetLogger("Torch");
4848

4949
internal MultiplayerManager(ITorchBase torch)
5050
{

‎Torch/PluginManager.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Torch
2222
public class PluginManager : IPluginManager
2323
{
2424
private readonly ITorchBase _torch;
25-
private static Logger _log = LogManager.GetCurrentClassLogger();
25+
private static Logger _log = LogManager.GetLogger("Torch");
2626
public const string PluginDir = "Plugins";
2727

2828
private readonly List<ITorchPlugin> _plugins = new List<ITorchPlugin>();

‎Torch/Reflection.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public static bool HasProperty(Type objectType, string propertyName)
111111
}
112112
}
113113

114-
public static object InvokeStatic(Type type, string methodName, params object[] args)
114+
public static object InvokeStaticMethod(Type type, string methodName, params object[] args)
115115
{
116116
var method = type.GetMethod(methodName, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
117117
if (method == null)

0 commit comments

Comments
 (0)