1. Stylelabs.M.Sdk.Models.Logging

Class ConsoleLogger

A simple console logger that can print with or without a built-in template.

The template is: "DateTime | LogLevel | Message".

The minimum log level is info by default.

Inheritance

object

LoggerBase

ConsoleLogger

Implements

ILogger

Inherited Members

LoggerBase.OnLog

LoggerBase.IsDebugEnabled

LoggerBase.IsInfoEnabled

LoggerBase.IsWarnEnabled

LoggerBase.IsErrorEnabled

LoggerBase.MinimumLogLevel

LoggerBase.Debug(string)

LoggerBase.Debug(Func)

LoggerBase.DebugAsync(Func<Task>)

LoggerBase.Info(string)

LoggerBase.Info(Func)

LoggerBase.InfoAsync(Func<Task>)

LoggerBase.Warn(string)

LoggerBase.Warn(Func)

LoggerBase.WarnAsync(Func<Task>)

LoggerBase.Error(string, Exception)

LoggerBase.Error(Exception)

LoggerBase.Error(Func, Exception)

LoggerBase.ErrorAsync(Func<Task>, Exception)

Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsLogging

Assembly: Stylelabs.M.Sdk.dll

Syntax

public class ConsoleLogger : LoggerBase, ILogger

Properties

UseTemplate

Gets or sets a value indicating whether enables or disables logging using a template.

Declaration

public bool UseTemplate { get; set; }

Property Value

TypeDescription
bool

Methods

LogDebug(string)

Logs debug-level information.

Declaration

protected override void LogDebug(string message)

Parameters

TypeNameDescription
stringmessageThe message to log.

Overrides

LoggerBase.LogDebug(string)

LogError(Exception)

Logs error-level information.

Declaration

protected override void LogError(Exception exception)

Parameters

TypeNameDescription
ExceptionexceptionThe exception to log.

Overrides

LoggerBase.LogError(Exception)

LogError(string, Exception)

Logs error-level information.

Declaration

protected override void LogError(string message, Exception exception)

Parameters

TypeNameDescription
stringmessageThe message to log.
ExceptionexceptionThe exception to log.

Overrides

LoggerBase.LogError(string, Exception)

LogInfo(string)

Logs info-level information.

Declaration

protected override void LogInfo(string message)

Parameters

TypeNameDescription
stringmessageThe message to log.

Overrides

LoggerBase.LogInfo(string)

LogWarn(string)

Logs warning-level information.

Declaration

protected override void LogWarn(string message)

Parameters

TypeNameDescription
stringmessageThe message to log.

Overrides

LoggerBase.LogWarn(string)

Implements

ILogger

If you have suggestions for improving this article, let us know!