Show / Hide Table of Contents

Interface ILogAdapter

An abstraction of some mechanism for producing log output.

Namespace: LaunchDarkly.Logging
Assembly: LaunchDarkly.Logging.dll
Syntax
public interface ILogAdapter
Remarks

Any LaunchDarkly library that can generate log output through LaunchDarkly.Logging has a configuration option of type ILogAdapter, which defines the implementation details of what to do with the log output. Built-in basic implementations are available through the Logs class, and adapters that delegate to other logging frameworks can be provided by other LaunchDarkly packages or by the application.

The basic model is that whatever component will be writing to the logs will define at least one name for an output channel. The adapter's NewChannel(String) method takes a name and returns a low-level IChannel implementation that accepts log messages for any LogLevel; this is wrapped in the standard Logger class, which is what the rest of the LaunchDarkly library code interacts with.

Applications should not need to interact directly with ILogAdapter, beyond the initial configuration step of choosing which one to use.

Methods

NewChannel(String)

The logger calls this method to obtain a named output channel.

Declaration
IChannel NewChannel(string name)
Parameters
Type Name Description
System.String name

an identifying name

Returns
Type Description
IChannel

an implementation of IChannel

Remarks

The name will be included in all log output for this channel. Channels are meant to be retained and reused by the components they belong to, so the ILogAdapter does not need to cache them.

Extension Methods

ILogAdapterExtensions.Level(ILogAdapter, LogLevel)
ILogAdapterExtensions.Logger(ILogAdapter, String)
In This Article
Back to top Generated by DocFX