using System; namespace SabreTools.Logging { /// /// Generic delegate type for log events /// public delegate void LogEventHandler(object? sender, LogEventArgs args); /// /// Logging specific event arguments /// public class LogEventArgs : EventArgs { /// /// LogLevel for the event /// public readonly LogLevel LogLevel; /// /// Log statement to be printed /// public readonly string? Statement = null; /// /// Exception to be passed along to the event handler /// public readonly Exception? Exception = null; /// /// Total count for progress log events /// public readonly long? TotalCount = null; /// /// Current count for progress log events /// public readonly long? CurrentCount = null; /// /// Statement constructor /// public LogEventArgs(LogLevel logLevel, string statement) { LogLevel = logLevel; Statement = statement; } /// /// Statement constructor /// public LogEventArgs(LogLevel logLevel, Exception exception) { LogLevel = logLevel; Exception = exception; } /// /// Statement and exception constructor /// public LogEventArgs(LogLevel logLevel, string statement, Exception exception) { LogLevel = logLevel; Statement = statement; Exception = exception; } /// /// Progress constructor /// public LogEventArgs(long total, long current, LogLevel logLevel, string? statement = null) { LogLevel = logLevel; Statement = statement; TotalCount = total; CurrentCount = current; } } }