DataSource.NET
8.0.3.290770-7760911e
|
Definition of the interface that will receive logging messages from a Caplin application. More...
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... | |
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.
void Caplin.Logging.ILogger.Log | ( | LogLevels | level, |
string | category, | ||
string | message | ||
) |
Logs a single message with a given severity and category.
level | The logging level, indicating the severity of the message to be logged. |
category | The log category. This identifies the type of message being logged or the component from which the message originates. |
message | The 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.
level | The logging level, indicating the severity of the message to be logged. |
category | The log category. This identifies the type of message being logged or the component from which the message originates. |
message | The message to be logged. |
messageParameters | One 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.
level | The logging level, indicating the severity of the message to be logged. |
categories | An arrary of log categories. These categories identify the type of message being logged and the components from which the message originates. |
message | The 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.
level | The logging level, indicating the severity of the message to be logged. |
categories | An arrary of log categories. These categories identify the type of message being logged and the components from which the message originates. |
message | The message to be logged. |
messageParameters | One or more message parameter values that are to be substituted into message . |
Implemented in Caplin.Logging.ConsoleLogger.