Example #1
0
 private static void HandleLog(string message, string stackTrace, LogType logType)
 {
     if (!string.IsNullOrEmpty(message) && !Filter.Any(message.Contains))
     {
         Interface.Oxide.RootLogger.HandleMessage(message, stackTrace, logType.ToLogType());
     }
 }
        private static void HandleLog(string message, string stackTrace, LogType logType)
        {
            if (!string.IsNullOrEmpty(message) && !Filter.Any(message.StartsWith))
            {
#if DEBUG
                Interface.uMod.LogDebug("Game state: " + AppSate.Startup);
#endif
                if (!Dedicated)
                {
                    switch (logType)
                    {
                    case LogType.Error:
                    case LogType.Assert:
                    case LogType.Exception:
                    {
                        Shell.Print(string.Concat("<#FF0000>", message, "</color>"));
                        Shell.Print(string.Concat("<#FF7F7F>", stackTrace, "</color>"));
                        break;
                    }

                    case LogType.Warning:
                    {
                        Shell.Print(string.Concat("<#FFFF00>", message, "</color>"));
                        break;
                    }

                    case LogType.Log:
                    {
                        Shell.Print(message);
                        break;
                    }

                    default:
                    {
                        goto case LogType.Log;
                    }
                    }
                }

                Interface.uMod.RootLogger.HandleMessage(message, stackTrace, logType.ToLogType());
            }
        }