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
name
stringName 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
logLevel
LogLevelSelected log level.
Returns
- bool
A value whether indicating
logLevel
is enabled.
Log(LogLevel, string, ILisrtModule)
Logs text with LogLevel.
public void Log(LogLevel loglevel, string message, ILisrtModule module = null)
Parameters
loglevel
LogLevelLevel for the log.
message
stringMessage to log.
module
ILisrtModuleModule 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
moduleName
stringThe full name of ILisrtModule.
direction
TransmissionDirectionThe transmission direction.
data
stringThe communication data.
comment
stringSome comment for the sent/received data.
LogMessage(IMessage)
Logs a message.
public void LogMessage(IMessage message)
Parameters
message
IMessageMessage to be logged.
LogMessage(IMessage, StackTrace)
Logs a message.
public void LogMessage(IMessage message, StackTrace stackTrace)
Parameters
message
IMessageIMessage to be logged. When null then a ArgumentNullException is logged.
stackTrace
StackTraceFor adding the correct class- and method-name to the log. If it's null, the correct name is not guaranteed.