Introduce the LuaCsLogger class and make everything use that instead
This commit is contained in:
@@ -814,8 +814,8 @@ namespace Barotrauma
|
||||
{
|
||||
argsSb.Append(arg + " ");
|
||||
}
|
||||
luaCs.PrintError($"Error in Hook '{name}'->'{key}', with args '{argsSb}':\n{e}", LuaCsMessageOrigin.Unknown);
|
||||
luaCs.HandleException(e, LuaCsMessageOrigin.Unknown);
|
||||
LuaCsLogger.LogError($"Error in Hook '{name}'->'{key}', with args '{argsSb}':\n{e}", LuaCsMessageOrigin.Unknown);
|
||||
LuaCsLogger.HandleException(e, LuaCsMessageOrigin.Unknown);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1177,10 +1177,9 @@ namespace Barotrauma
|
||||
il.If((il) =>
|
||||
{
|
||||
// IL: LuaCs.HandleException(exception, LuaCsMessageOrigin.LuaMod);
|
||||
il.LoadField(luaCsField);
|
||||
il.LoadLocal(exception);
|
||||
il.LoadConstant((int)LuaCsMessageOrigin.LuaMod); // underlying enum type is int
|
||||
il.Call(typeof(LuaCsSetup).GetMethod(nameof(LuaCsSetup.HandleException), BindingFlags.NonPublic | BindingFlags.Instance));
|
||||
il.Call(typeof(LuaCsLogger).GetMethod(nameof(LuaCsLogger.HandleException), BindingFlags.Public | BindingFlags.Static));
|
||||
});
|
||||
|
||||
il.EndCatchBlock(catchBlock);
|
||||
@@ -1227,7 +1226,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (methodPatches.Prefixes.Remove(identifier))
|
||||
{
|
||||
luaCs.PrintMessage($"Replacing existing prefix: {identifier}");
|
||||
LuaCsLogger.LogMessage($"Replacing existing prefix: {identifier}");
|
||||
}
|
||||
|
||||
methodPatches.Prefixes.Add(identifier, new LuaCsPatch
|
||||
@@ -1240,7 +1239,7 @@ namespace Barotrauma
|
||||
{
|
||||
if (methodPatches.Postfixes.Remove(identifier))
|
||||
{
|
||||
luaCs.PrintMessage($"Replacing existing postfix: {identifier}");
|
||||
LuaCsLogger.LogMessage($"Replacing existing postfix: {identifier}");
|
||||
}
|
||||
|
||||
methodPatches.Postfixes.Add(identifier, new LuaCsPatch
|
||||
|
||||
Reference in New Issue
Block a user