ILogger Interface
The ILogger interface is a fundamental component of the gSharp logging system, providing a standardized way to log messages from your assemblies. It allows you to capture important information about the execution of your code, which can be invaluable for debugging and monitoring purposes.
Properties
| Property | Description |
|---|---|
| Name | Logical name of the logger. |
| IsTraceEnabled | Indicates whether LogLevel.Trace messages are enabled. |
| IsDebugEnabled | Indicates whether LogLevel.Debug messages are enabled. |
| IsInfoEnabled | Indicates whether LogLevel.Info messages are enabled. |
| IsWarnEnabled | Indicates whether LogLevel.Warn messages are enabled. |
| IsErrorEnabled | Indicates whether LogLevel.Error messages are enabled. |
| IsFatalEnabled | Indicates whether LogLevel.Fatal messages are enabled. |
| SuppressionEnabled | Enables or disables log suppression. |
| SuppressionMode | How similar log entries are compared for suppression. |
| SuppressionThreshold | Maximum similar entries before suppression starts. |
| SuppressionMinimumLevel | Lowest level where suppression is applied. |
Methods
| Method | Description |
|---|---|
| IsLevelEnabled | Tests whether a specified log level is enabled. |
| ResetSuppression | Clears any log suppression state. |
| Fatal | Writes fatal-level log entries. |
| Error | Writes error-level log entries. |
| Warn | Writes warning-level log entries. |
| Info | Writes informational-level log entries. |
| Debug | Writes debug-level log entries. |
| Trace | Writes trace-level log entries. |
| Log | Writes log entries at an arbitrary log level. |
See Also
- ILogContext — Describes the log context interface used with ILogger.
- LogEvent — Value object that carries the data for a single log entry.
- Logging Basics — Overview of structured logging in gSharp.