DataSource.NET  6.2.20.310828
Caplin.Logging.ILogger Interface Reference

Definition of the interface that will receive logging messages from a Caplin application. More...

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

Public Member Functions

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...
 

Detailed Description

Definition of the interface that will receive logging messages from a Caplin application.

If you want your application to log errors and other activity then the ILogger interface should be implemented.

The class that implements ILogger can also be coded to log information originating from the application itself. In this way you can use one single logger to record information originating from both your application and the Caplin application.

The ILogger interface defines one method named ILogger.Log(LogLevels, string, string) with various overloads. The first argument of Log() is an enumeration which identifies the severity of the message.

The second argument is either a String identifying the category associated with the log message, or a String array that identifies several such categories.

Both the Caplin.Logging.LogLevels enumeration and the category can be used to filter the messages in the implemented Log() methods, allowing the application to only log information relating to particular severities and/or associated categories.

Warning
The ILogger methods are not called on a dedicated worker thread. Therefore, if any of these methods are likely to take a relatively long time to execute, they should be coded to run in a separate thread.

Member Function Documentation

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

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.

Implemented in Caplin.Logging.ConsoleLogger.

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

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 .

Implemented in Caplin.Logging.ConsoleLogger.

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

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.

Implemented in Caplin.Logging.ConsoleLogger.

void Caplin.Logging.ILogger.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.

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 .

Implemented in Caplin.Logging.ConsoleLogger.


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