Exemplo n.º 1
0
        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);
                }
        }
Exemplo n.º 2
0
 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));
         }
 }
Exemplo n.º 3
0
 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);
         }
 }
Exemplo n.º 4
0
 /// <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);
         }
 }
Exemplo n.º 5
0
        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();
            }
        }