From 1d183807961277e5ec3d450cd9c139b479475993 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Thu, 26 Oct 2023 15:16:20 +0900 Subject: [PATCH 1/3] chore: do not show error report window if no errors --- Internal/ErrorReporter/Editor/BuildReportContext.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Internal/ErrorReporter/Editor/BuildReportContext.cs b/Internal/ErrorReporter/Editor/BuildReportContext.cs index 34ec5c738..d2d8ee340 100644 --- a/Internal/ErrorReporter/Editor/BuildReportContext.cs +++ b/Internal/ErrorReporter/Editor/BuildReportContext.cs @@ -39,8 +39,6 @@ public void OnDeactivate(BuildContext context) BuildReport.SaveReport(); if (avatar.logs.Any()) ErrorReportUI.OpenErrorReportUIFor(avatar); - else - ErrorReportUI.MaybeOpenErrorReportUI(); if (!successful) throw new Exception("Avatar processing failed"); } } From 4bca5af7c1ec7ee586414e81bc73c56d3e6dfd6d Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Thu, 26 Oct 2023 15:19:37 +0900 Subject: [PATCH 2/3] chore: output error report logs to unity default logs --- Internal/ErrorReporter/Editor/BuildReport.cs | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Internal/ErrorReporter/Editor/BuildReport.cs b/Internal/ErrorReporter/Editor/BuildReport.cs index c488325cb..1a90c1ebe 100644 --- a/Internal/ErrorReporter/Editor/BuildReport.cs +++ b/Internal/ErrorReporter/Editor/BuildReport.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using System.Text; using JetBrains.Annotations; using UnityEditor; using UnityEngine; @@ -102,6 +103,27 @@ internal static ErrorLog Log(ReportLevel level, string code, string[] strings, A strings[i] = strings[i] ?? ""; var errorLog = new ErrorLog(level, code, strings, assembly); + var builder = new StringBuilder("BuildReport: "); + builder.Append(code); + foreach (var s in strings) + builder.Append(", '").Append(s).Append("'"); + switch (level) + { + case ReportLevel.Validation: + case ReportLevel.Error: + case ReportLevel.InternalError: + Debug.LogError(builder.ToString()); + break; + case ReportLevel.Info: + Debug.Log(builder.ToString()); + break; + case ReportLevel.Warning: + Debug.LogWarning(builder.ToString()); + break; + default: + throw new ArgumentOutOfRangeException(nameof(level), level, null); + } + var avatarReport = CurrentReport.CurrentAvatar; if (avatarReport == null) { From a95cdc0dc27ea0a43060269985b69afab4420c41 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Thu, 26 Oct 2023 15:22:30 +0900 Subject: [PATCH 3/3] docs(changelog): All logs passed to ErrorReport is now shown on the console log --- CHANGELOG-PRERELEASE.md | 1 + CHANGELOG.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG-PRERELEASE.md b/CHANGELOG-PRERELEASE.md index 9b75dddf0..1b9bfcefb 100644 --- a/CHANGELOG-PRERELEASE.md +++ b/CHANGELOG-PRERELEASE.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog]. - Small performance improve `#641` ### Changed +- All logs passed to ErrorReport is now shown on the console log `#643` ### Deprecated diff --git a/CHANGELOG.md b/CHANGELOG.md index d2fbcb7ea..b890ce23d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog]. - Small performance improve `#641` ### Changed +- All logs passed to ErrorReport is now shown on the console log `#643` ### Deprecated