2023-01-19 20:32:44 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using nadena.dev.modular_avatar.core;
|
2023-12-21 16:38:46 +08:00
|
|
|
|
using nadena.dev.modular_avatar.core.editor;
|
|
|
|
|
using nadena.dev.ndmf;
|
2023-01-19 20:32:44 +08:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEditor;
|
|
|
|
|
using UnityEngine.SceneManagement;
|
|
|
|
|
using Object = UnityEngine.Object;
|
|
|
|
|
|
|
|
|
|
namespace nadena.dev.modular_avatar.editor.ErrorReporting
|
|
|
|
|
{
|
|
|
|
|
internal class BuildReport
|
|
|
|
|
{
|
|
|
|
|
private const string Path = "Library/ModularAvatarBuildReport.json";
|
|
|
|
|
|
2023-12-21 16:38:46 +08:00
|
|
|
|
internal static void Log(ErrorSeverity severity, string code, params object[] objects)
|
2023-01-19 20:32:44 +08:00
|
|
|
|
{
|
2023-12-21 16:38:46 +08:00
|
|
|
|
ErrorReport.ReportError(Localization.L, severity, code, objects);
|
2023-01-19 20:32:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-21 16:38:46 +08:00
|
|
|
|
internal static void LogFatal(string code, params object[] objects)
|
2023-01-19 20:32:44 +08:00
|
|
|
|
{
|
2023-12-21 16:38:46 +08:00
|
|
|
|
ErrorReport.ReportError(Localization.L, ErrorSeverity.Error, code, objects);
|
2023-01-19 20:32:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal static void LogException(Exception e, string additionalStackTrace = "")
|
|
|
|
|
{
|
2023-12-21 16:38:46 +08:00
|
|
|
|
ErrorReport.ReportException(e, additionalStackTrace);
|
2023-01-19 20:32:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal static T ReportingObject<T>(UnityEngine.Object obj, Func<T> action)
|
|
|
|
|
{
|
2023-12-21 16:38:46 +08:00
|
|
|
|
return ErrorReport.WithContextObject(obj, action);
|
2023-01-19 20:32:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal static void ReportingObject(UnityEngine.Object obj, Action action)
|
|
|
|
|
{
|
2023-12-21 16:38:46 +08:00
|
|
|
|
ErrorReport.WithContextObject(obj, action);
|
2023-01-19 20:32:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-12-21 16:38:46 +08:00
|
|
|
|
[Obsolete("Use NDMF's ObjectRegistry instead")]
|
2023-01-19 20:32:44 +08:00
|
|
|
|
public static void RemapPaths(string original, string cloned)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|