Skip to main content

Class Logger

Class encapsulating logging providers and functions

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

Properties​

GroupsToShow​

Gets the list of groups used for displaying log messages.

View Source​
Declaration
public List<string> GroupsToShow { get; }

ShowGroup​

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

View Source​
Declaration
public bool ShowGroup { get; set; }

ShowTicks​

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

View Source​
Declaration
public bool ShowTicks { get; set; }

LogLevel​

Gets or sets the current log level

View Source​
Declaration
public LogLevel LogLevel { get; set; }

Methods​

AddProvider(ILogProvider)​

Adds an ILogProvider to the providers collection

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

Trace(string, string?)​

Sends a Trace-level message to all ILogProviders

View Source​
Declaration
public void Trace(string message, string? messageGroup = null)
Parameters​
TypeNameDescription
System.StringmessageThe message to send to Providers
System.StringmessageGroupThe (optional) message group

TraceIf(bool, string, string?)​

Conditionally sends a Trace-level message to all ILogProviders

View Source​
Declaration
public void TraceIf(bool condition, string message, string? messageGroup = null)
Parameters​
TypeNameDescription
System.BooleanconditionThe message will be sent to Providers only when this is true
System.StringmessageThe message to send to Providers
System.StringmessageGroupThe (optional) message group

Debug(string, string?)​

Sends a Debug-level message to all ILogProviders

View Source​
Declaration
public void Debug(string message, string? messageGroup = null)
Parameters​
TypeNameDescription
System.StringmessageThe message to send to Providers
System.StringmessageGroupThe (optional) message group

DebugIf(bool, string, string?)​

Conditionally sends a Debug-level message to all ILogProviders

View Source​
Declaration
public void DebugIf(bool condition, string message, string? messageGroup = null)
Parameters​
TypeNameDescription
System.BooleanconditionThe message will be sent to Providers only when this is true
System.StringmessageThe message to send to Providers
System.StringmessageGroupThe (optional) message group

Info(string, string?)​

Sends an Info-level message to all ILogProviders

View Source​
Declaration
public void Info(string message, string? messageGroup = null)
Parameters​
TypeNameDescription
System.StringmessageThe message to send to Providers
System.StringmessageGroupThe (optional) message group

InfoIf(bool, string, string?)​

Conditionally sends a Info-level message to all ILogProviders

View Source​
Declaration
public void InfoIf(bool condition, string message, string? messageGroup = null)
Parameters​
TypeNameDescription
System.BooleanconditionThe message will be sent to Providers only when this is true
System.StringmessageThe message to send to Providers
System.StringmessageGroupThe (optional) message group

Warn(string, string?)​

Sends a Warn-level message to all ILogProviders

View Source​
Declaration
public void Warn(string message, string? messageGroup = null)
Parameters​
TypeNameDescription
System.StringmessageThe message to send to Providers
System.StringmessageGroupThe (optional) message group

WarnIf(bool, string, string?)​

Conditionally sends a Warn-level message to all ILogProviders

View Source​
Declaration
public void WarnIf(bool condition, string message, string? messageGroup = null)
Parameters​
TypeNameDescription
System.BooleanconditionThe message will be sent to Providers only when this is true
System.StringmessageThe message to send to Providers
System.StringmessageGroupThe (optional) message group

Error(Exception, string?)​

Sends a Error-level message to all ILogProviders

View Source​
Declaration
public void Error(Exception exception, string? messageGroup = null)
Parameters​
TypeNameDescription
System.ExceptionexceptionThe exception to translate and send to Providers
System.StringmessageGroupThe (optional) message group

Error(string, string?)​

Sends a Error-level message to all ILogProviders

View Source​
Declaration
public void Error(string message, string? messageGroup = null)
Parameters​
TypeNameDescription
System.StringmessageThe message to send to Providers
System.StringmessageGroupThe (optional) message group

ErrorIf(bool, string, string?)​

Conditionally sends a Error-level message to all ILogProviders

View Source​
Declaration
public void ErrorIf(bool condition, string message, string? messageGroup = null)
Parameters​
TypeNameDescription
System.BooleanconditionThe message will be sent to Providers only when this is true
System.StringmessageThe message to send to Providers
System.StringmessageGroupThe (optional) message group