Table of Contents

Interface ILogger

Namespace
Loehnert.Lisrt.Contracts
Assembly
Loehnert.Lisrt.dll

Represents an interface for all loggers to be accessible by the MessageService.

public interface ILogger

Properties

Name

Gets the name for the logger.

string Name { get; }

Property Value

string

Name as string.

Methods

IsEnabled(LogLevel)

Returns a value whether indicating logLevel is enabled.

bool IsEnabled(LogLevel logLevel)

Parameters

logLevel LogLevel

Selected log level.

Returns

bool

A value whether indicating logLevel is enabled.

Log(LogLevel, string, ILisrtModule)

Logs text with LogLevel.

void Log(LogLevel loglevel, string message, ILisrtModule module = null)

Parameters

loglevel LogLevel

Level for the log.

message string

Message to log.

module ILisrtModule

Module where the log comes from (default = null).

LogCommunication(string, TransmissionDirection, string, string)

Logs the communication of a device.

void LogCommunication(string moduleName, TransmissionDirection direction, string data, string comment = "")

Parameters

moduleName string

Full module name where the log comes from.

direction TransmissionDirection

The direction of communication.

data string

The sent data as string.

comment string

An additional comment. This should be th name of the calling function.

LogMessage(IMessage)

Logs a message.

void LogMessage(IMessage message)

Parameters

message IMessage

Message that is logged.

LogMessage(IMessage, StackTrace)

Logs the message which implements IMessage.

void LogMessage(IMessage message, StackTrace stackTrace)

Parameters

message IMessage

Message to log with IMessage-Interface.

stackTrace StackTrace

StackTrace with the correct Stack where the Log happened.