SimpleLog/SimpleLog/ILogger.cs
2009-04-12 02:31:35 +00:00

48 lines
1.5 KiB
C#

namespace SimpleLog {
public interface ILogger : IMessageFormatter {
/// <summary>
/// Registers a log handler with this logger
/// </summary>
/// <param name="handler">The log handler to register</param>
void RegisterLogHandler(ILogHandler handler);
/// <summary>
/// Unregisters the given log handler
/// </summary>
/// <returns>TRUE if successfully unregistered, FALSE if not</returns>
//bool UnregisterLogHandler(ILogHandler handler);
/// <summary>
/// Removes all log handlers that match the given assembly name
/// </summary>
/// <returns>Number of log handlers that were unregistered</returns>
int UnregisterLogHandlerType(string assemblyName);
/// <summary>
/// Unregisters all registered log handlers
/// </summary>
/// <returns>Number of log handlers that were unregistered</returns>
int UnregisterAllLogHandlers();
/// <summary>
/// Gets or sets the log level
/// </summary>
LogLevel LogLevel {get; set;}
/// <summary>
/// Logs a message at the specified log level
/// </summary>
/// <param name="message">The message to log</param>
/// <param name="level">The log level of the message</param>
/// <returns>TRUE if all handler succesfully logged, or false if any of them failed</returns>
bool Log(object message, LogLevel level);
/// <summary>
/// Gets or sets the message handler
/// </summary>
IMessageHandler MessageHandler { get; set; }
}
}