diff --git a/Torch/Managers/KeenLogPatch.cs b/Torch/Managers/KeenLogPatch.cs index ce9d8a9..08e70c8 100644 --- a/Torch/Managers/KeenLogPatch.cs +++ b/Torch/Managers/KeenLogPatch.cs @@ -131,7 +131,15 @@ namespace Torch.Managers private static bool PrefixLogFormatted(MyLog __instance, MyLogSeverity severity, string format, object[] args) { - _log.Log(LogLevelFor(severity), PrepareLog(__instance).AppendFormat(format, args)); + // Sometimes this is called with a pre-formatted string and no args + // and causes a crash when the format string contains braces + var sb = PrepareLog(__instance); + if (args != null && args.Length > 0) + sb.AppendFormat(format, args); + else + sb.Append(format); + + _log.Log(LogLevelFor(severity), sb); return false; }