using EchoHub.Core.Models;
using Serilog.Events;
namespace EchoHub.Server.Config;
///
/// Live server-log room settings, bound from the "ServerLogs" config section (env override:
/// ServerLogs__Enabled etc.). When enabled, a read-only system channel is auto-created
/// and log events are streamed to it live — log lines are never stored as messages in the
/// database; the rolling Serilog log files remain the only persistence.
///
public sealed class ServerLogsOptions
{
/// Master switch for the live log room.
public bool Enabled { get; set; } = true;
///
/// Name of the auto-created system channel. Must satisfy the normal channel-name rules;
/// the name is reserved — users cannot create a channel with it.
///
public string RoomName { get; set; } = "server-logs";
/// Minimum server role allowed to see and join the log room (Member/Mod/Admin/Owner).
public ServerRole MinRole { get; set; } = ServerRole.Mod;
///
/// Minimum level of log events streamed to the room (Verbose/Debug/Information/Warning/
/// Error/Fatal). Only affects the room — file and console sinks keep their own levels.
///
public LogEventLevel MinLevel { get; set; } = LogEventLevel.Information;
/// How many recent log entries are replayed from the log file when someone opens the room.
public int BacklogLines { get; set; } = 100;
/// Directory holding the rolling log files. Must match the Serilog file sink's path.
public string LogDirectory { get; set; } = "logs";
/// Filename glob for the rolling log files inside .
public string LogFilePattern { get; set; } = "echohub-server-*.log";
/// Channel names are stored lowercased; compare against this form.
public string NormalizedRoomName => RoomName.ToLowerInvariant().Trim();
}