using SPTarkov.DI.Annotations; using SPTarkov.Server.Core.Models.Logging; using SPTarkov.Server.Core.Models.Spt.Logging; using SPTarkov.Server.Core.Models.Utils; using LogLevel = SPTarkov.Server.Core.Models.Spt.Logging.LogLevel; namespace SPTarkov.Server.Core.Controllers; [Injectable] public class ClientLogController( ISptLogger _logger ) { /// /// Handle /singleplayer/log /// /// public void ClientLog(ClientLogRequest logRequest) { var message = $"[{logRequest.Source}] {logRequest.Message}"; var color = logRequest.Color ?? LogTextColor.White; var backgroundColor = logRequest.BackgroundColor ?? LogBackgroundColor.Default; _logger.Log(logRequest.Level ?? LogLevel.Info, message, color, backgroundColor); } }