using System; namespace SabreTools.Logging { /// /// Per-class logging /// public class Logger { /// /// Instance associated with this logger /// /// TODO: Derive class name for this object, if possible private readonly object? instance; /// /// Constructor /// public Logger(object? instance = null) { this.instance = instance; } #region Log Event Triggers /// /// Write the given exception as a verbose message to the log output /// /// Exception to be written log /// String to be written log /// True if the output could be written, false otherwise public void Verbose(Exception ex, string? output = null) { LoggerImpl.Verbose(this.instance, ex, output); } /// /// Write the given string as a verbose message to the log output /// /// String to be written log /// True if the output could be written, false otherwise public void Verbose(string output) { LoggerImpl.Verbose(this.instance, output); } /// /// Write the given verbose progress message to the log output /// /// Total count for progress /// Current count for progres /// String to be written log public void Verbose(long total, long current, string? output = null) { LoggerImpl.Verbose(instance, total, current, output); } /// /// Write the given exception as a user message to the log output /// /// Exception to be written log /// String to be written log /// True if the output could be written, false otherwise public void User(Exception ex, string? output = null) { LoggerImpl.User(this.instance, ex, output); } /// /// Write the given string as a user message to the log output /// /// String to be written log /// True if the output could be written, false otherwise public void User(string output) { LoggerImpl.User(this.instance, output); } /// /// Write the given user progress message to the log output /// /// Total count for progress /// Current count for progres /// String to be written log public void User(long total, long current, string? output = null) { LoggerImpl.User(instance, total, current, output); } /// /// Write the given exception as a warning to the log output /// /// Exception to be written log /// String to be written log /// True if the output could be written, false otherwise public void Warning(Exception ex, string? output = null) { LoggerImpl.Warning(this.instance, ex, output); } /// /// Write the given string as a warning to the log output /// /// String to be written log /// True if the output could be written, false otherwise public void Warning(string output) { LoggerImpl.Warning(this.instance, output); } /// /// Write the given warning progress message to the log output /// /// Total count for progress /// Current count for progres /// String to be written log public void Warning(long total, long current, string? output = null) { LoggerImpl.Warning(instance, total, current, output); } /// /// Writes the given exception as an error in the log /// /// Exception to be written log /// String to be written log /// True if the output could be written, false otherwise public void Error(Exception ex, string? output = null) { LoggerImpl.Error(this.instance, ex, output); } /// /// Writes the given string as an error in the log /// /// String to be written log /// True if the output could be written, false otherwise public void Error(string output) { LoggerImpl.Error(this.instance, output); } /// /// Write the given error progress message to the log output /// /// Total count for progress /// Current count for progres /// String to be written log public void Error(long total, long current, string? output = null) { LoggerImpl.Error(instance, total, current, output); } #endregion } }