예제 #1
0
        void ILogHandler.LogException(Exception exception, UnityEngine.Object context)
        {
            System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace(exception, true);

            unityHandler.LogException(exception, context);
            LogEntry(LogType.Exception, exception.Message + "\n" + trace.ToString());
        }
예제 #2
0
        public void LogException(Exception exception, Object context)
        {
            baseLogHandler.LogException(exception, context);

            if (exception is ReflectionTypeLoadException ex)
            {
                string message = "Intercepted a ReflectionTypeLoadException. List of broken DLLs:\n";
                try
                {
                    var assemblies = ex.Types.Where(x => x != null).Select(x => x.Assembly).Distinct();
                    foreach (Assembly assembly in assemblies)
                    {
                        if (Warnings == "")
                        {
                            Warnings = "Mod(s) DLL that are not compatible with this version of KSP\n";
                        }
                        string modInfo = assembly.GetName().Name + " " + assembly.GetName().Version + " " +
                                         assembly.Location.Remove(0, gamePathLength) + "\n";
                        if (!brokenAssemblies.Contains(assembly))
                        {
                            brokenAssemblies.Add(assembly);
                            Warnings += modInfo;
                        }
                        message += modInfo;
                    }
                }
                catch (Exception e)
                {
                    message += "Exception " + e.GetType().Name + " while handling the exception...";
                }
                ModuleManager.Log(message);
            }
        }
예제 #3
0
        public void LogException(Exception exception, Object context)
        {
            baseLogHandler.LogException(exception, context);

            if (exception is ReflectionTypeLoadException ex)
            {
                string message = "Intercepted a ReflectionTypeLoadException. List of broken DLLs:\n";
                try
                {
                    IEnumerable <Assembly> assemblies = ex.Types.Where(x => x != null).Select(x => x.Assembly).Distinct();
                    foreach (Assembly assembly in assemblies)
                    {
                        if (string.IsNullOrEmpty(Warnings))
                        {
                            Warnings = "Add'On(s) DLL that have failed to be dynamically linked on loading\n";
                        }
                        string modInfo = assembly.GetName().Name + " " + assembly.GetName().Version + " " +
                                         assembly.Location.Remove(0, gamePathLength) + "\n";
                        if (!brokenAssemblies.Contains(assembly))
                        {
                            brokenAssemblies.Add(assembly);
                            Warnings += modInfo;
                        }
                        message += modInfo;
                    }
                }
                catch (Exception e)
                {
                    message += "Exception " + e.GetType().Name + " while handling the exception...";
                }
                Logging.ModLogger.LOG.error("**FATAL** {0}", message);
                GUI.ShowStopperAlertBox.Show(message);
            }
        }
예제 #4
0
    void ILogHandler.LogException(Exception exception, UnityEngine.Object context)
    {
        if (!EnableLog)
        {
            return;
        }

        m_DefaultLogHandler.LogException(exception, context);
    }
예제 #5
0
 void ILogHandler.LogException(Exception exception, UnityEngine.Object context)
 {
     originalLogHandler.LogException(exception, context);
     if (Application.isPlaying)
     {
         GameObject newLog = Instantiate <GameObject>(logTemplate, logTemplate.transform.parent);
         newLog.GetComponent <Text>().text = exception.ToString();
         otherLogs.Add(newLog);
     }
 }
        public void LogException(Exception exception, UnityObject context)
        {
            if (m_HookedLogger == null)
            {
                throw new InvalidOperationException($"{nameof(ExportConfigurationLogHandler)} is not hooked into the logger. Exceptions can't be recorded.");
            }

            m_HookedLogger?.LogException(exception, context);
            m_JournalData.RecordExceptionEvent(context, exception);
            m_FailureLogs = true;
        }
예제 #7
0
        public void LogException(Exception exception, UnityEngine.Object context)
        {
            // Missing reference exceptions when the application is quitting should be ignored
            if (exception is MissingReferenceException && Systems.IsQuitting)
            {
                return;
            }

            if (DebugMode.ConsoleDump.IsEnabled())
            {
                exception.LogToConsole();
            }

            defaultLogHandler.LogException(exception, context);
            if (exception is UserException userException)
            {
                LogUserException(userException);
            }
        }
    public static int LogException(IntPtr l)
    {
        int result;

        try
        {
            ILogHandler logHandler = (ILogHandler)LuaObject.checkSelf(l);
            Exception   exception;
            LuaObject.checkType <Exception>(l, 2, out exception);
            UnityEngine.Object context;
            LuaObject.checkType <UnityEngine.Object>(l, 3, out context);
            logHandler.LogException(exception, context);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
예제 #9
0
        private Task HandleExceptionAsync(HttpContext context, Exception exception)
        {
            _logger.LogException(exception);

            string msg = exception.Message;

            context.Response.ContentType = "application/json";
            context.Response.StatusCode  = (int)HttpStatusCode.InternalServerError;

            // TODO: might need to create a factory to handle the exceptions
            // e.g. using IExceptionHandler singleton...
            HttpException httpException = exception as HttpException;

            if (null != httpException)
            {
                context.Response.StatusCode = httpException.StatusCode;
            }

            return(context.Response.WriteAsync(
                       _appConfig.AppOptions.ErrFormat(msg)
                       ));
        }
예제 #10
0
 public void LogException(Exception exception, UnityEngine.Object context)
 {
     defaultHandler.LogException(exception, context);
 }
예제 #11
0
 void ILogHandler.LogException(Exception exception, UnityEngine.Object context)
 {
     defaultLogHandler.LogException(new Exception(loggerTag, exception), context);
 }
예제 #12
0
 public static void LogException(Exception exception, UnityEngine.Object context = null)
 {
     logHandler.LogException(exception, context);
 }
 public void LogException(Exception exception, UnityEngine.Object context)
 {
     // Pass on the message to the original logger so that it can be displayed on the console
     m_OriginalLogger.LogException(exception, context);
 }
예제 #14
0
 public void LogException(System.Exception exception, Object context)
 {
     ConsoleLog.Log(exception.Message);
     ConsoleLog.Log(exception.StackTrace);
     defaultLogHandler.LogException(exception, context);
 }
예제 #15
0
 public void LogException(Exception exception, UnityEngine.Object context)
 {
     HasErrors = true;
     inner.LogException(exception, context);
 }
예제 #16
0
 public void LogException(Exception exception, UnityEngine.Object context)
 {
     _log.Write(GetPrefix(LogType.Exception), 0, Framework.Log.FormatException(exception));
     _native.LogException(exception, context);
 }
예제 #17
0
 public void LogException(System.Exception exception, Object context)
 {
     defaultLogHandler.LogException(exception, context);
 }
예제 #18
0
 /// <summary>
 /// 例外に関するログを出力する
 /// </summary>
 /// <param name="exception">例外</param>
 /// <param name="context">コンテキスト</param>
 public void LogException(Exception exception, Object context)
 {
     _handler.LogException(exception, context);
 }
예제 #19
0
 public void LogException(System.Exception exception, UnityEngine.Object context)
 {
     text.text += "\n" + exception.ToString() + " - " + context.ToString();
     baseHandler.LogException(exception, context);
 }
예제 #20
0
 public void LogException(Exception exception, UnityEngine.Object context)
 {
     labelRenderer.AddTimedLabel(exception.ToString(), LOG_DELAY * 3);
     original.LogException(exception, context);
 }
예제 #21
0
 public void LogException(Exception exception, UnityEngine.Object context)
 {
     Console.Error("Unhandled exception!\n" + exception);
     FallbackHandler.LogException(exception, context);
 }
예제 #22
0
 void ILogHandler.LogException(Exception exception, UnityEngine.Object context)
 {
     unityLogHandler.LogException(exception, context);
 }
예제 #23
0
 public void LogException(Exception exception, UnityObject context)
 {
     k_DefaultLogHandler.LogFormat(LogType.Log, m_Context, "Context: {0} ({1})", m_Context, AssetDatabase.GetAssetPath(m_Context));
     k_DefaultLogHandler.LogException(exception, context);
 }
예제 #24
0
 public void LogException(Exception exception, UnityEngine.Object context)
 {
     _logger1.LogException(exception, context);
     _logger2.LogException(exception, context);
 }