public static void Log(string category, ELogVerbosity verbosity, string message) { if (verbosity == ELogVerbosity.Fatal) { string callstack = null; try { callstack = Environment.StackTrace; } catch { } FMessage.OpenDialog("Fatal error from C# (USharp):" + Environment.NewLine + Environment.NewLine + message + Environment.NewLine + Environment.NewLine + "Callstack:" + Environment.NewLine + Environment.NewLine + callstack); } if (string.IsNullOrEmpty(category)) { category = "USharp"; } using (FStringUnsafe messageUnsafe = new FStringUnsafe(message)) using (FStringUnsafe categoryUnsafe = new FStringUnsafe(category)) { Native_FMessageDialog.Log(ref messageUnsafe.Array, ref categoryUnsafe.Array, verbosity); } }
public static EAppReturnType OpenDialog(EAppMsgType messageType, string message, string optTitle) { using (FStringUnsafe messageUnsafe = new FStringUnsafe(message)) using (FStringUnsafe optTitleUnsafe = new FStringUnsafe(optTitle)) { return(Native_FMessageDialog.Open(messageType, ref messageUnsafe.Array, ref optTitleUnsafe.Array)); } }
public static void Log(string category, ELogVerbosity verbosity, string message) { if (string.IsNullOrEmpty(category)) { category = "USharp"; } using (FStringUnsafe messageUnsafe = new FStringUnsafe(message)) using (FStringUnsafe categoryUnsafe = new FStringUnsafe(category)) { Native_FMessageDialog.Log(ref messageUnsafe.Array, ref categoryUnsafe.Array, verbosity); } }
/// <summary> /// Creates a fatal log (this will crash the engine). This is the same Log("error", ELogVerbosity.Fatal); but doesn't show a message dialog /// </summary> public static void Crash(string message) { if (FGlobals.IsCriticalError) { // This will ensure that the engine actually crashes on this call FGlobals.IsCriticalError = false; } using (FStringUnsafe messageUnsafe = new FStringUnsafe(message)) using (FStringUnsafe categoryUnsafe = new FStringUnsafe("USharp")) { Native_FMessageDialog.Log(ref messageUnsafe.Array, ref categoryUnsafe.Array, ELogVerbosity.Fatal); } }
private static void FocusOutputLogTab() { if (disableExceptionNotifier) { return; } // Add a delay between each tab focus to avoid sitations where the user can't get way from the tab. if (lastFocusOutputLogTab < DateTime.Now - focusOutputLogTabDelay) { lastFocusOutputLogTab = DateTime.Now; Native_FMessageDialog.FocusOutputLogTab(); } }