![](../icons/collapse_all.gif)
C# | Visual Basic | Visual C++ |
public interface ILogger
Public Interface ILogger
public interface class ILogger
![](../icons/collapse_all.gif)
All Members | Methods | ||||
Icon | Member | Description |
---|---|---|
![]() | 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.
|
![](../icons/collapse_all.gif)
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 the application and the StreamLink.NET library.
The ILogger interface defines one method named Log(SourceLevels, String, String) with various overloads. The first argument of Log() is a Microsoft .NET SourceLevels enum 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 arrary that identifies several such categories. An example of a category is RawDataIn; log messages with this category contain RTTP messages. For the list of logging categories used by StreaMlink, see LoggingCategories.
Both the SourceLevels enum 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.
![](../icons/CopyCode.gif)
using System; using System.Collections.Generic; using System.Text; using Caplin.StreamLink; using Caplin.StreamLink.Logging; using System.Diagnostics; using Caplin.StreamLink.Authentication; namespace StreamLinkExamples.Basics { /// <summary> /// Example inner class that implements ILogger and /// a an outline of how it may be used. /// </summary> public class SettingUpALogger { /// <summary> /// Example of a class that implements ILogger and /// a an outline of how it may be used. /// </summary> public static void SettingUpALoggerExample() { StreamLink myStreamLink = new StreamLink(); // Set the logger property to start using the console logger myStreamLink.Logger = new ConsoleLogger(); } } }
![](../icons/collapse_all.gif)
The ILogger methods are not called on a dedicated worker thread. Therefore, if any of these methods are likely take a relatively long time to execute, they should be coded to run in a separate thread.