C# | Visual Basic | Visual C++ |
public class ConsoleLogger : ILogger, IExceptionHandler
Public Class ConsoleLogger _ Implements ILogger, IExceptionHandler
public ref class ConsoleLogger : ILogger, IExceptionHandler
All Members | Constructors | Methods | Properties | ||
Icon | Member | Description |
---|---|---|
ConsoleLogger()()() |
Initializes a new instance of the ConsoleLogger class
that logs messages of all levels (severities) and categories.
| |
ConsoleLogger(array<String>[]()[]) |
Initializes a new instance of the ConsoleLogger class
that only logs messages in the categories specified by logCategoryFilter.
| |
Equals(Object) | (Inherited from Object.) | |
Finalize()()() |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) | |
GetHashCode()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
GetType()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
HandleException(Exception) |
Logs a StreamLink exception.
This method is automatically called by StreamLink once the ConsoleLogger
has been registered with the StreamLink instance as an exception handler.
| |
Level |
The lowest level (severity) that messages are logged at.
For example, if Level is set to SourceLevels.Information
then only messages at Information level and above will be logged
(that is, messages at levels Information, Warning, Error, Critical).
The default value is SourceLevels.All, which causes messages at all levels to be logged.
| |
Log(SourceLevels, String, String) |
Logs a single message with a given severity and category.
| |
Log(SourceLevels, String, String, array<String>[]()[]) |
Logs a single message with supplied parameter values substituted into it.
| |
Log(SourceLevels, array<String>[]()[], String) |
Logs a single message with a given severity and one or more categories.
| |
Log(SourceLevels, array<String>[]()[], String, array<String>[]()[]) |
Logs a single message with a given severity and one or more categories,
and with supplied parameter values substituted into it.
| |
MemberwiseClone()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
ToString()()() | (Inherited from Object.) |
This simple implementation of ILogger is provided for use when developing StreamLink enabled applications, and you should not normally use it in deployed applications. In applications for deployment you are recommended to use a fully featured logging framework, such as Apache log4net.
The ConsoleLogger must be registered with StreamLink so that StreamLink exceptions will automatically be logged through calls to HandleException(Exception), and StreamLink errors and other activity will automatically be logged through calls to the various ConsoleLogger.Log methods. Register by setting both the ExceptionHandler and Logger properties of the StreamLink object to the instance of ConsoleLogger,
For information on how to use the inbuilt FileLogger instead of ConsoleLogger, see FileLoggerConfiguration.
Object | |
ConsoleLogger |