Interface ILogger
Represents an interface for all loggers to be accessible by the MessageService.
Namespace: Loehnert.Lisrt.Contracts
Assembly: Loehnert.Lisrt.dll
Syntax
public interface ILogger
Properties
Name
Gets the name for the logger.
Declaration
string Name { get; }
Property Value
Type | Description |
---|---|
String | Name as String. |
Methods
IsEnabled(LogLevel)
Returns a value whether indicating logLevel
is enabled.
Declaration
bool IsEnabled(LogLevel logLevel)
Parameters
Type | Name | Description |
---|---|---|
LogLevel | logLevel | Selected log level. |
Returns
Type | Description |
---|---|
Boolean | A value whether indicating |
Log(LogLevel, String, ILisrtModule)
Logs text with LogLevel.
Declaration
void Log(LogLevel loglevel, string message, ILisrtModule module = null)
Parameters
Type | Name | Description |
---|---|---|
LogLevel | loglevel | Level for the log. |
String | message | Message to log. |
ILisrtModule | module | Module where the log comes from (default = null). |
LogCommunication(String, TransmissionDirection, String, String)
Logs the communication of a device.
Declaration
void LogCommunication(string moduleName, TransmissionDirection direction, string data, string comment = "")
Parameters
Type | Name | Description |
---|---|---|
String | moduleName | Full module name where the log comes from. |
TransmissionDirection | direction | The direction of communication. |
String | data | The sent data as String. |
String | comment | An additional comment. This should be th name of the calling function. |
LogMessage(IMessage)
Logs a message.
Declaration
void LogMessage(IMessage message)
Parameters
Type | Name | Description |
---|---|---|
IMessage | message | Message that is logged. |
LogMessage(IMessage, StackTrace)
Logs the message which implements IMessage.
Declaration
void LogMessage(IMessage message, StackTrace stackTrace)
Parameters
Type | Name | Description |
---|---|---|
IMessage | message | Message to log with IMessage-Interface. |
System.Diagnostics.StackTrace | stackTrace | StackTrace with the correct Stack where the Log happened. |