modular-avatar/Editor/ErrorReporting/ErrorLog.cs
bd_ d297cf1cad
feat(error): Integrate with NDMF error reporting and localization system (#570)
* chore(i18n): initial integration with NDMF localization system

* feat(error): integrate with NDMF error reporting framework

Note that as part of this, the pre-build validation system has been disabled for now.
It didn't work very well with other NDMF plugins in the first place, so it's probably
for the best...

* chore: fix u2019 build errors
2023-12-21 17:38:46 +09:00

50 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using nadena.dev.modular_avatar.core;
using nadena.dev.modular_avatar.core.editor;
using nadena.dev.ndmf;
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";
internal static void Log(ErrorSeverity severity, string code, params object[] objects)
{
ErrorReport.ReportError(Localization.L, severity, code, objects);
}
internal static void LogFatal(string code, params object[] objects)
{
ErrorReport.ReportError(Localization.L, ErrorSeverity.Error, code, objects);
}
internal static void LogException(Exception e, string additionalStackTrace = "")
{
ErrorReport.ReportException(e, additionalStackTrace);
}
internal static T ReportingObject<T>(UnityEngine.Object obj, Func<T> action)
{
return ErrorReport.WithContextObject(obj, action);
}
internal static void ReportingObject(UnityEngine.Object obj, Action action)
{
ErrorReport.WithContextObject(obj, action);
}
[Obsolete("Use NDMF's ObjectRegistry instead")]
public static void RemapPaths(string original, string cloned)
{
}
}
}