bool DebugReportCallback(DebugReportCallbackInfo drci) { string spew = $"[{drci.Flags}][{drci.LayerPrefix}] {drci.Message}"; Misc.SafeInvoke(eErrorSpam, spew); return(drci.Flags.HasFlag(DebugReportFlagsExt.Error)); }
/// <summary> /// Called for debug reports /// </summary> /// <param name="info"></param> /// <returns></returns> private static bool OnDebugReport(DebugReportCallbackInfo info) { // Is this an error? var error = (info.Flags & DebugReportFlagsExt.Error) != 0; // Is this a warning? var warning = (info.Flags & DebugReportFlagsExt.Warning) != 0 || (info.Flags & DebugReportFlagsExt.PerformanceWarning) != 0; // Choose print method Action <string, string> printMethod = Debug.Info; if (error) { printMethod = Debug.Error; } else if (warning) { printMethod = Debug.Warning; } // Print the report printMethod($"{info.Message} (#{info.MessageCode})", $"Layer {info.LayerPrefix}; Object {info.Object}"); // Return true if this was an error return(error); }
private bool OnDebugReport(DebugReportCallbackInfo args) { logger?.Log(nameof(Host), $"[{args.Flags}] [{args.LayerPrefix}] {args.Message}"); return(false); //Returning false will keep the app running, returning true will abort }