private void OnLogReceive(ApplicationLogHandler.LogInfo logInfo) { var srDebug = SRDebug.Instance; if (srDebug == null) { return; } var changeColor = true; var ignoreWarnings = new string[] { "SpriteAtlasManager.atlasRequested wasn't listened to while", }; foreach (var ignore in ignoreWarnings) { if (logInfo.Condition.StartsWith(ignore)) { return; } } if (currentLogType.HasValue) { var priority = LogPriority.IndexOf(x => x == logInfo.Type); var current = LogPriority.IndexOf(x => x == currentLogType.Value); changeColor = current < priority; } if (changeColor) { var color = defaultColor; switch (logInfo.Type) { case LogType.Warning: color = warningColor; break; case LogType.Error: color = errorColor; break; case LogType.Exception: color = exceptionColor; break; } if (!srDebug.IsDebugPanelVisible) { background.color = lastShowLogTime < Time.realtimeSinceStartup ? color : defaultColor; } currentLogType = logInfo.Type; } }
private void OnLogReceive(ApplicationLogHandler.LogInfo logInfo) { var changeColor = true; //----- TODO: Unity2018.2以降で無駄な警告が出るので、修正されるまで除外. ----- var ignoreUnity2018_2Warnings = new string[] { "Your multi-scene setup may be improved by tending to the following issues", "Your current multi-scene setup has inconsistent Lighting settings", }; foreach (var ignore in ignoreUnity2018_2Warnings) { if (logInfo.Condition.StartsWith(ignore)) { return; } } //----------------------------------------------------------------------------------- if (currentLogType.HasValue) { var priority = LogPriority.IndexOf(x => x == logInfo.Type); var current = LogPriority.IndexOf(x => x == currentLogType.Value); changeColor = current < priority; } if (changeColor) { var color = defaultColor; switch (logInfo.Type) { case LogType.Warning: color = warningColor; break; case LogType.Error: color = errorColor; break; case LogType.Exception: color = exceptionColor; break; } if (!SRDebug.Instance.IsDebugPanelVisible) { background.color = lastShowLogTime < Time.realtimeSinceStartup ? color : defaultColor; } currentLogType = logInfo.Type; } }
private static void LogCallback(ApplicationLogHandler.LogInfo log) { if (log == null) { return; } var item = new LogEntry(log.Type, log.Condition, log.StackTrace); reportQueue.Enqueue(item); }
private void LogCallback(ApplicationLogHandler.LogInfo log) { if (log == null) { return; } var item = new LogEntry() { type = log.Type, message = log.Condition, stackTrace = log.StackTrace, }; reportQueue.Enqueue(item); }