DataSource.NET  6.2.20.310828
Caplin.Logging.ConsoleLogger Class Reference

The ConsoleLogger implements the Caplin.Logging.ILogger interface and outputs all log messages to the console. More...

Inheritance diagram for Caplin.Logging.ConsoleLogger:
Caplin.Logging.ILogger Caplin.Exceptions.IExceptionHandler

Public Member Functions

 ConsoleLogger ()
 Initializes a new instance of the ConsoleLogger class that logs all messages (does not filter by log level). More...
 
 ConsoleLogger (string[] categories)
 Initializes a new instance of the ConsoleLogger class that logs only the specified categories of message for any log level. More...
 
 ConsoleLogger (string[] categories, LogLevels level)
 Initializes a new instance of the ConsoleLogger class that logs only the specified categories of messages, filtered by log level. More...
 
 ConsoleLogger (LogLevels level)
 Initializes a new instance of the ConsoleLogger class that logs messages filtered by log level. More...
 
void HandleException (Exception ex)
 Logs a Caplin API exception. This method is automatically called by the Caplin library once the ConsoleLogger has been registered with the library instance as an exception handler. More...
 
void Log (LogLevels level, string category, string message)
 Logs a single message with a given severity and category. More...
 
void Log (LogLevels level, string category, string message, params Object[] messageParameters)
 Logs a single message with supplied parameter values substituted into it. More...
 
void Log (LogLevels level, string[] categories, string message)
 Logs a single message with a given severity and one or more categories. More...
 
void Log (LogLevels level, string[] categories, string message, params Object[] messageParameters)
 Logs a single message with a given severity and one or more categories, and with supplied parameter values substituted into it. More...
 

Properties

LogLevels Level [get, set]
 The lowest level (severity) at which messages are logged at. More...
 

Detailed Description

The ConsoleLogger implements the Caplin.Logging.ILogger interface and outputs all log messages to the console.

Constructor & Destructor Documentation

Caplin.Logging.ConsoleLogger.ConsoleLogger ( )
inline

Initializes a new instance of the ConsoleLogger class that logs all messages (does not filter by log level).

Caplin.Logging.ConsoleLogger.ConsoleLogger ( string[]  categories)
inline

Initializes a new instance of the ConsoleLogger class that logs only the specified categories of message for any log level.

Parameters
categoriesThe categories to be logged. This identifies the type of messages being logged or the component from which the message originates.
Caplin.Logging.ConsoleLogger.ConsoleLogger ( string[]  categories,
LogLevels  level 
)
inline

Initializes a new instance of the ConsoleLogger class that logs only the specified categories of messages, filtered by log level.

Parameters
categoriesThe categories to be logged. This identifies the type of messages being logged or the component from which the message originates.
levelThe log filter level. Only messages with a log level that is at or above this value are logged.
Caplin.Logging.ConsoleLogger.ConsoleLogger ( LogLevels  level)
inline

Initializes a new instance of the ConsoleLogger class that logs messages filtered by log level.

Parameters
levelThe log filter level. Only messages with a log level that is at or above this value are logged.

Member Function Documentation

void Caplin.Logging.ConsoleLogger.HandleException ( Exception  ex)
inline

Logs a Caplin API exception. This method is automatically called by the Caplin library once the ConsoleLogger has been registered with the library instance as an exception handler.

Parameters
exThe exception raised by the library.

Implements Caplin.Exceptions.IExceptionHandler.

void Caplin.Logging.ConsoleLogger.Log ( LogLevels  level,
string  category,
string  message 
)
inline

Logs a single message with a given severity and category.

Parameters
levelThe logging level, indicating the severity of the message to be logged.
categoryThe log category. This identifies the type of message being logged or the component from which the message originates.
messageThe message to be logged.

Implements Caplin.Logging.ILogger.

void Caplin.Logging.ConsoleLogger.Log ( LogLevels  level,
string  category,
string  message,
params Object[]  messageParameters 
)
inline

Logs a single message with supplied parameter values substituted into it.

The message can contain C# format specifiers that correspond to the message parameters. The method should substitute the message parameters into the supplied message (using System.String.Format(String, Object[])), to produce a readable message that is then logged.

Parameters
levelThe logging level, indicating the severity of the message to be logged.
categoryThe log category. This identifies the type of message being logged or the component from which the message originates.
messageThe message to be logged.
messageParametersOne or more message parameter values that are to be substituted into message .

Implements Caplin.Logging.ILogger.

void Caplin.Logging.ConsoleLogger.Log ( LogLevels  level,
string[]  categories,
string  message 
)
inline

Logs a single message with a given severity and one or more categories.

Parameters
levelThe logging level, indicating the severity of the message to be logged.
categoriesAn arrary of log categories. These categories identify the type of message being logged and the components from which the message originates.
messageThe message to be logged.

Implements Caplin.Logging.ILogger.

void Caplin.Logging.ConsoleLogger.Log ( LogLevels  level,
string[]  categories,
string  message,
params Object[]  messageParameters 
)
inline

Logs a single message with a given severity and one or more categories, and with supplied parameter values substituted into it.

The message can contain C# format specifiers that correspond to the message parameters. The method should substitute the message parameters into the supplied message (using System.String.Format(String, Object[])), to produce a readable message that is then logged.

Parameters
levelThe logging level, indicating the severity of the message to be logged.
categoriesAn arrary of log categories. These categories identify the type of message being logged and the components from which the message originates.
messageThe message to be logged.
messageParametersOne or more message parameter values that are to be substituted into message .

Implements Caplin.Logging.ILogger.

Property Documentation

LogLevels Caplin.Logging.ConsoleLogger.Level
getset

The lowest level (severity) at which messages are logged at.

For example, if Level is set to LogLevels.Info then only messages at Info level and above will be logged (that is, messages at levels Info, Warning, Notify, Error, Config, Critical). The default value is SourceLevels.Finest, which causes messages at all levels to be logged.

The log level at and above which messages are to be logged.


Generated on Wed Jan 24 2018 12:22:40 for DataSource.NET