Yodiwo.DebugEx.TraceWarning C# (CSharp) Méthode

TraceWarning() private méthode

private TraceWarning ( Exception ex, string message, [ filePath = "", [ lineNumber, [ method = "" ) : void
ex System.Exception
message string
filePath [
lineNumber [
method [
Résultat void
        public static void TraceWarning(Exception ex, string message, [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0, [CallerMemberNameAttribute] string method = "")
        {
            if (LogLevel > eTraceType.Warning)
                return;
#if DEBUG
            try { var p = Path.GetFileName(filePath); } catch { Debug.Assert(false, "Invalid Log message"); };
#endif
            //two spaces after warn not a typo
            while (ex != null)
            {
                var stack = ex.StackTrace;
#if NETFX
                try { Trace.WriteLine(String.Format("{0} Warn  {1} [{2}:{3}] :: {4}", DateTime.Now, Path.GetFileName(filePath), method, lineNumber, message + " (" + ex.Message + ")" + Environment.NewLine + "StackTrace : " + stack)); } catch { }
#elif UNIVERSAL
                try { Debug.WriteLine(String.Format("{0} Warn  {1} [{2}:{3}] :: {4}", DateTime.Now, Path.GetFileName(filePath), method, lineNumber, message + " (" + ex.Message + ")" + Environment.NewLine + "StackTrace : " + stack)); } catch { }
#endif
                try { TraceLine?.Invoke(eTraceType.Warning, String.Format("{0} Warn  {1} [{2}:{3}] :: {4}", DateTime.Now, Path.GetFileName(filePath), method, lineNumber, message + " (" + ex.Message + ")" + Environment.NewLine + "StackTrace : " + stack)); } catch { }
                ex = ex.InnerException;
            }
        }

Same methods

DebugEx::TraceWarning ( string message, [ filePath = "", [ lineNumber, [ method = "" ) : void