Class NLogWrapper
Wraps the NLog.Logger to a ILogger.
public class NLogWrapper : ILogger
- Inheritance
-
NLogWrapper
- Implements
- Inherited Members
Constructors
NLogWrapper(string)
Initializes a new instance of the NLogWrapper class.
public NLogWrapper(string name)
Parameters
namestringName of the logger.
Fields
NLogConfigurationFileName
Gets the name for the NLog configuration file ('NLog.config').
public static readonly string NLogConfigurationFileName
Field Value
Properties
Name
Gets the name of the logger.
public string Name { get; }
Property Value
Methods
IsEnabled(LogLevel)
Returns a value whether indicating logLevel is enabled.
public bool IsEnabled(LogLevel logLevel)
Parameters
logLevelLogLevelSelected log level.
Returns
- bool
A value whether indicating
logLevelis enabled.
Log(LogLevel, string, ILisrtModule)
Logs text with LogLevel.
public void Log(LogLevel loglevel, string message, ILisrtModule module = null)
Parameters
loglevelLogLevelLevel for the log.
messagestringMessage to log.
moduleILisrtModuleModule where the log comes from (default = null).
LogCommunication(string, TransmissionDirection, string, string)
Logs a Communication log.
public void LogCommunication(string moduleName, TransmissionDirection direction, string data, string comment = "")
Parameters
moduleNamestringThe full name of ILisrtModule.
directionTransmissionDirectionThe transmission direction.
datastringThe communication data.
commentstringSome comment for the sent/received data.
LogMessage(IMessage)
Logs a message.
public void LogMessage(IMessage message)
Parameters
messageIMessageMessage to be logged.
LogMessage(IMessage, StackTrace)
Logs a message.
public void LogMessage(IMessage message, StackTrace stackTrace)
Parameters
messageIMessageIMessage to be logged. When null then a ArgumentNullException is logged.
stackTraceStackTraceFor adding the correct class- and method-name to the log. If it's null, the correct name is not guaranteed.