modular-avatar/Editor/ErrorReporting/ErrorLog.cs

50 lines
1.5 KiB
C#
Raw Normal View History

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;
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";
internal static void Log(ErrorSeverity severity, string code, params object[] objects)
2023-01-19 20:32:44 +08:00
{
ErrorReport.ReportError(Localization.L, severity, code, objects);
2023-01-19 20:32:44 +08:00
}
internal static void LogFatal(string code, params object[] objects)
2023-01-19 20:32:44 +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 = "")
{
ErrorReport.ReportException(e, additionalStackTrace);
2023-01-19 20:32:44 +08:00
}
internal static T ReportingObject<T>(UnityEngine.Object obj, Func<T> action)
{
return ErrorReport.WithContextObject(obj, action);
2023-01-19 20:32:44 +08:00
}
internal static void ReportingObject(UnityEngine.Object obj, Action action)
{
ErrorReport.WithContextObject(obj, action);
2023-01-19 20:32:44 +08:00
}
[Obsolete("Use NDMF's ObjectRegistry instead")]
2023-01-19 20:32:44 +08:00
public static void RemapPaths(string original, string cloned)
{
}
}
}