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)
{
_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(_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(_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(_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(_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(_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(_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(_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(_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
}
}