using System;
namespace SabreTools.Library.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 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 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);
}
///
/// 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);
}
#endregion
}
}