#region --------------- Copyright Dresser Wayne Pignone -------------
/*
* $Log: /Wrk/WayneLibraries/Wrk/Log/ExternalLogWriter.cs $
*
* 3 08-02-26 13:23 Mattias.larsson
* Corrected the method-summaries.
*
* 2 08-02-15 10:17 Mattias.larsson
* Changed the interface to an abstract class.
*/
#endregion
using System.Collections.Generic;
namespace Wayne.Lib.Log
{
///
/// Interface to an external log writer
///
public abstract class ExternalLogWriter
{
#region Properties
///
/// Identifies the type of external log writer used in the configuration.
///
public abstract string ExternalLogType { get; }
///
/// Identifies the external log writer used in the configuration.
///
public abstract string ExternalLogName { get; }
///
/// Tells whether the log writer is currently active.
///
public abstract bool Active { get; }
#endregion
#region Methods
internal void InitParametersInternal(Dictionary dictionary)
{
InitParameters(dictionary);
}
internal void LogInternal(LogEntry logEntry, string formattedText)
{
Log(logEntry, formattedText);
}
///
/// Get the LogTextWritingParameters.
///
/// Returns the LogTextWritingParameters.
protected LogTextWritingParameters GetExternalLoggerWritingParameters()
{
return Logger.GetExternalLoggerWritingParameters(this);
}
///
/// Called once just before the first log entry.
///
/// The Param-nodes from the XML-config file
protected abstract void InitParameters(Dictionary dictionary);
///
/// Called when a log entry should be handled by this external log writer.
///
/// The LogEntry to log.
/// The LogEntry as a formatted string.
protected abstract void Log(LogEntry logEntry, string formattedText);
#endregion
}
}