public static void Exception(string className, string message, System.Exception exception, [CallerMemberName] string methodName = "") { exception = exception.Demystify(); #if DEBUG ExceptionDispatchInfo.Capture(exception).Throw(); #else var classNameWithMethod = CheckClassAndMessageAndReturnFullClassWithMethod(className, message, methodName); ExceptionInternal(classNameWithMethod, message, exception); #endif }
/// <param name="message">example: "|prefix|unprefixed" </param> /// <param name="e">Exception</param> public static void Exception(string message, System.Exception e) { e = e.Demystify(); #if DEBUG ExceptionDispatchInfo.Capture(e).Throw(); #else if (FormatValid(message)) { var parts = message.Split('|'); var prefix = parts[1]; var unprefixed = parts[2]; ExceptionInternal(prefix, unprefixed, e); } else { LogFaultyFormat(message); } #endif }