forked from Misaki/GhostEngine
Refactor and enhance codebase for maintainability
Refactored and reorganized the codebase to improve readability, performance, and maintainability. Introduced new interfaces and structs for better resource management, updated project configuration files, and refactored shader and graphics pipeline management. Improved error handling, code formatting, and removed unused code and namespaces. Updated DLL references and method signatures for consistency and maintainability.
This commit is contained in:
@@ -9,7 +9,7 @@ public enum LogLevel
|
||||
Error
|
||||
}
|
||||
|
||||
internal struct LogMessage
|
||||
internal readonly struct LogMessage
|
||||
{
|
||||
public LogLevel Level
|
||||
{
|
||||
@@ -58,10 +58,9 @@ internal interface ILogger
|
||||
}
|
||||
|
||||
public void Log(string message, LogLevel level);
|
||||
|
||||
public void Log(Exception exception);
|
||||
|
||||
public void Assert(bool condition, string message);
|
||||
public void Clear();
|
||||
}
|
||||
|
||||
// TODO: Add file logging.
|
||||
@@ -98,6 +97,14 @@ internal class LoggerImplementation : ILogger
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
lock (_lock)
|
||||
{
|
||||
_logs.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class Logger
|
||||
@@ -149,4 +156,14 @@ public static class Logger
|
||||
{
|
||||
s_logger.Log(ex);
|
||||
}
|
||||
|
||||
public static void Assert(bool condition, string message)
|
||||
{
|
||||
s_logger.Assert(condition, message);
|
||||
}
|
||||
|
||||
public static void Clear()
|
||||
{
|
||||
s_logger.Clear();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user