Better LoggerService

This commit is contained in:
Evil Factory
2026-02-09 19:51:31 -03:00
parent 64831bd580
commit a61e705dbf
4 changed files with 128 additions and 123 deletions
@@ -5,11 +5,21 @@ using Microsoft.Xna.Framework;
namespace Barotrauma.LuaCs;
public readonly record struct PendingLog(string Message, Color? Color, ServerLog.MessageType MessageType);
public interface ILoggerSubscriber
{
void OnLog(PendingLog pendingLog);
}
/// <summary>
/// Provides console and debug logging services
/// </summary>
public interface ILoggerService : IReusableService
{
void Subscribe(ILoggerSubscriber subscriber);
void Unsubscribe(ILoggerSubscriber subscriber);
void ProcessLogs();
void HandleException(Exception exception, string prefix = null);
void LogError(string message);
void LogWarning(string message);