Skip to content

Commit

Permalink
chore: output error report logs to unity default logs
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Oct 26, 2023
1 parent 1d18380 commit 4bca5af
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Internal/ErrorReporter/Editor/BuildReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using JetBrains.Annotations;
using UnityEditor;
using UnityEngine;
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 4bca5af

Please sign in to comment.