Class Logger
Class encapsulating logging providers and functions
Assembly: Meadow.Logging.dll
View Source
public class Logger
Properties
GroupsToShow
Gets the list of groups used for displaying log messages.
View Source
public List<string> GroupsToShow { get; }
ShowGroup
Gets or sets a value indicating whether to show message groups in log messages
View Source
public bool ShowGroup { get; set; }
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
Type | Name |
---|---|
Meadow.Logging.ILogProvider | provider |
Trace(string, string?)
Sends a Trace-level message to all ILogProviders
View Source
public void Trace(string message, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to send to Providers |
System.String | messageGroup | The (optional) message group |
TraceIf(bool, string, string?)
Conditionally sends a Trace-level message to all ILogProviders
View Source
public void TraceIf(bool condition, string message, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | condition | The message will be sent to Providers only when this is true |
System.String | message | The message to send to Providers |
System.String | messageGroup | The (optional) message group |
Debug(string, string?)
Sends a Debug-level message to all ILogProviders
View Source
public void Debug(string message, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to send to Providers |
System.String | messageGroup | The (optional) message group |
DebugIf(bool, string, string?)
Conditionally sends a Debug-level message to all ILogProviders
View Source
public void DebugIf(bool condition, string message, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | condition | The message will be sent to Providers only when this is true |
System.String | message | The message to send to Providers |
System.String | messageGroup | The (optional) message group |
Info(string, string?)
Sends an Info-level message to all ILogProviders
View Source
public void Info(string message, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to send to Providers |
System.String | messageGroup | The (optional) message group |
InfoIf(bool, string, string?)
Conditionally sends a Info-level message to all ILogProviders
View Source
public void InfoIf(bool condition, string message, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | condition | The message will be sent to Providers only when this is true |
System.String | message | The message to send to Providers |
System.String | messageGroup | The (optional) message group |
Warn(string, string?)
Sends a Warn-level message to all ILogProviders
View Source
public void Warn(string message, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to send to Providers |
System.String | messageGroup | The (optional) message group |
WarnIf(bool, string, string?)
Conditionally sends a Warn-level message to all ILogProviders
View Source
public void WarnIf(bool condition, string message, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | condition | The message will be sent to Providers only when this is true |
System.String | message | The message to send to Providers |
System.String | messageGroup | The (optional) message group |
Error(Exception, string?)
Sends a Error-level message to all ILogProviders
View Source
public void Error(Exception exception, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | exception | The exception to translate and send to Providers |
System.String | messageGroup | The (optional) message group |
Error(string, string?)
Sends a Error-level message to all ILogProviders
View Source
public void Error(string message, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The message to send to Providers |
System.String | messageGroup | The (optional) message group |
ErrorIf(bool, string, string?)
Conditionally sends a Error-level message to all ILogProviders
View Source
public void ErrorIf(bool condition, string message, string? messageGroup = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | condition | The message will be sent to Providers only when this is true |
System.String | message | The message to send to Providers |
System.String | messageGroup | The (optional) message group |