Better LoggerService
This commit is contained in:
+10
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user