StreamLink for Silverlight
ILogger Interface
StreamLink for SilverlightCaplin.StreamLinkILogger
Definition of the interface that will receive logging messages from StreamLink.
Declaration Syntax
C#Visual BasicVisual C++
public interface ILogger
Public Interface ILogger
public interface class ILogger
Members
All MembersMethods



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

Remarks
If you want your application to log StreamLink errors and other activity, implement the ILogger interface. The application must register the ILogger with StreamLink by setting the Logger property of the StreamLink object.

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

The ILogger interface defines one method named Log(SourceLevels, String, String) with various overloads. The first argument of Log() is a SourceLevels 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. 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.

CopyC#
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();
        }
    }
}
Thread Safety

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.

Assembly: Caplin.StreamLink.Silverlight (Module: Caplin.StreamLink.Silverlight) Version: 5.0.13.0 (5.0.13.0)