public void LogFormat(LogType logType, Object context, string format, params object[] args) { var logger = GetLogger(context); LogMethod?method = null; switch (logType) { case LogType.Assert: case LogType.Exception: case LogType.Error: { method = logger.Error(); } break; case LogType.Warning: { method = logger.Warn(); } break; case LogType.Log: { method = logger.Info(); } break; } if (args?.Length > 0) { method?.CallFormat(context, format, args); } else { method?.Call(context, format); } }