StreamLink.NET  7.1.5-7.1.5-3946-4e293d0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Member Functions | List of all members
Caplin.StreamLink.ILogListener Interface Reference

Interface for receiving log messages from the StreamLink application. More...

Inheritance diagram for Caplin.StreamLink.ILogListener:
Caplin.StreamLink.ConsoleLogListener

Public Member Functions

void OnLog (Caplin.StreamLink.ILogInfo logInfo)
 Called when a StreamLink log message is to be logged. More...
 

Detailed Description

Interface for receiving log messages from the StreamLink application.

If you wish to capture StreamLink's log messages (for example, to write them to your own log window), implement this interface, create an instance of it, and attach it to an instance of ILogger.

The following code example shows a simple anonymous implementation of LogListener

using Caplin.StreamLink;
using System;
namespace com.caplin.streamlink.examplesnippets.logging
{
public class LogListenerSnippet
{
public LogListenerSnippet(IStreamLink streamLink)
{
streamLink.Logger.AddListener(new ExampleLogListener(), LogLevel.FINEST);
}
class ExampleLogListener : ILogListener
{
public void OnLog(ILogInfo logInfo)
{
Console.WriteLine(logInfo.Message);
}
}
}
}

Member Function Documentation

void Caplin.StreamLink.ILogListener.OnLog ( Caplin.StreamLink.ILogInfo  logInfo)

Called when a StreamLink log message is to be logged.

  • Parameters
    logInfoThe LogInfo object, containing the log message text and log level.

Implemented in Caplin.StreamLink.ConsoleLogListener.


Generated on Tue Mar 24 2020 11:57:50 for StreamLink.NET