feat: Implement LogViewer control and integrate into EditPage

- Added LogViewer control to display log messages with filtering options.
- Integrated LogViewer into EditPage for better log management.
- Updated EngineEditorWindow to navigate to EditPage.
- Enhanced Logger implementation for improved performance and stack trace capturing.
- Introduced PathUtility for path normalization.
- Refactored AssetManager to correct shader asset type naming.
- Removed obsolete AssetHandlerRegistryTests and cleaned up related tests.
- Updated ImportCoordinatorTests for streamlined asset import process.
This commit is contained in:
2026-04-22 20:25:14 +09:00
parent 884611181a
commit 3533d3367f
34 changed files with 1063 additions and 640 deletions

View File

@@ -1,6 +1,7 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text;
namespace Ghost.Core;
@@ -79,7 +80,7 @@ public static class Logger
// TODO: Add file logging.
private class LoggerImpl : ILogger
{
private readonly List<LogMessage> _logs = new List<LogMessage>();
private readonly List<LogMessage> _logs = new List<LogMessage>(1024);
private readonly Lock _lock = new Lock();
public IReadOnlyCollection<LogMessage> Logs => _logs;
@@ -87,11 +88,12 @@ public static class Logger
public bool CaptureStackTrace
{
get; set;
} = true;
}
public event Action<LogMessage>? OnLogAdded;
public event Action? OnLogsCleared;
[StackTraceHidden]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Log(string message, LogLevel level)

View File

@@ -0,0 +1,17 @@
using System.Runtime.CompilerServices;
namespace Ghost.Core.Utilities;
public static class PathUtility
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static string Normalize(string? path)
{
if (string.IsNullOrWhiteSpace(path))
{
return string.Empty;
}
return Path.GetFullPath(path).TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
}
}

View File

@@ -19,7 +19,7 @@ public enum AssetType
Texture = 0,
Mesh = 1,
Material = 2,
Shaders = 3,
Shader = 3,
Scene = 4,
Audio = 5,
Video = 6,