Skip to main content

Class Logger

Class encapsulating logging providers and functions

Assembly: Meadow.Logging.dll
View Source
public class Logger

Properties

ShowTicks

Gets or sets a value indicating whether to show ticks in log messages

View Source
public bool ShowTicks { get; set; }

LogLevel

Gets or sets the current log level

View Source
public LogLevel LogLevel { get; set; }

Methods

AddProvider(ILogProvider)

Adds an ILogProvider to the providers collection

View Source
public void AddProvider(ILogProvider provider)
Parameters
TypeName
Meadow.Logging.ILogProviderprovider

Trace(string)

Sends a Trace-level message to all ILogProviders

View Source
public void Trace(string message)
Parameters
TypeNameDescription
System.StringmessageThe message to send to Providers

TraceIf(bool, string)

Conditionally sends a Trace-level message to all ILogProviders

View Source
public void TraceIf(bool condition, string message)
Parameters
TypeNameDescription
System.BooleanconditionThe message will be sent to Providers only when this is true
System.StringmessageThe message to send to Providers

Debug(string)

Sends a Debug-level message to all ILogProviders

View Source
public void Debug(string message)
Parameters
TypeNameDescription
System.StringmessageThe message to send to Providers

DebugIf(bool, string)

Conditionally sends a Debug-level message to all ILogProviders

View Source
public void DebugIf(bool condition, string message)
Parameters
TypeNameDescription
System.BooleanconditionThe message will be sent to Providers only when this is true
System.StringmessageThe message to send to Providers

Info(string)

Sends an Info-level message to all ILogProviders

View Source
public void Info(string message)
Parameters
TypeNameDescription
System.StringmessageThe message to send to Providers

InfoIf(bool, string)

Conditionally sends a Info-level message to all ILogProviders

View Source
public void InfoIf(bool condition, string message)
Parameters
TypeNameDescription
System.BooleanconditionThe message will be sent to Providers only when this is true
System.StringmessageThe message to send to Providers

Warn(string)

Sends a Warn-level message to all ILogProviders

View Source
public void Warn(string message)
Parameters
TypeNameDescription
System.StringmessageThe message to send to Providers

WarnIf(bool, string)

Conditionally sends a Warn-level message to all ILogProviders

View Source
public void WarnIf(bool condition, string message)
Parameters
TypeNameDescription
System.BooleanconditionThe message will be sent to Providers only when this is true
System.StringmessageThe message to send to Providers

Error(Exception)

Sends a Error-level message to all ILogProviders

View Source
public void Error(Exception exception)
Parameters
TypeNameDescription
System.ExceptionexceptionThe exception to translate and send to Providers

Error(string)

Sends a Error-level message to all ILogProviders

View Source
public void Error(string message)
Parameters
TypeNameDescription
System.StringmessageThe message to send to Providers

ErrorIf(bool, string)

Conditionally sends a Error-level message to all ILogProviders

View Source
public void ErrorIf(bool condition, string message)
Parameters
TypeNameDescription
System.BooleanconditionThe message will be sent to Providers only when this is true
System.StringmessageThe message to send to Providers