Table of Contents

Interface ILogContext

Namespace
OpenQA.Selenium.Internal.Logging
Assembly
Selenium.WebDriver.dll

Represents a logging context that provides methods for creating sub-contexts, retrieving loggers, emitting log messages, and configuring minimum log levels.

public interface ILogContext : IDisposable
Inherited Members

Properties

Handlers

Gets a list of log handlers.

ILogHandlerList Handlers { get; }

Property Value

ILogHandlerList

Methods

CreateContext()

Creates a new logging context.

ILogContext CreateContext()

Returns

ILogContext

A new instance of ILogContext.

CreateContext(LogEventLevel)

Creates a new logging context with the specified minimum log level.

ILogContext CreateContext(LogEventLevel minimumLevel)

Parameters

minimumLevel LogEventLevel

The minimum log level for the new context.

Returns

ILogContext

A new instance of ILogContext with the specified minimum log level.

GetLogger(Type)

Gets a logger for the specified type.

ILogger GetLogger(Type type)

Parameters

type Type

The type for which to retrieve the logger.

Returns

ILogger

An instance of ILogger for the specified type.

GetLogger<T>()

Gets a logger for the specified type.

ILogger GetLogger<T>()

Returns

ILogger

An instance of ILogger for the specified type.

Type Parameters

T

The type for which to retrieve the logger.

SetLevel(LogEventLevel)

Sets the minimum log level for the current context.

ILogContext SetLevel(LogEventLevel level)

Parameters

level LogEventLevel

The minimum log level.

Returns

ILogContext

The current instance of ILogContext with the minimum log level set.

SetLevel(Type, LogEventLevel)

Sets the minimum log level for the specified type in the current context.

ILogContext SetLevel(Type issuer, LogEventLevel level)

Parameters

issuer Type

The type for which to set the minimum log level.

level LogEventLevel

The minimum log level.

Returns

ILogContext

The current instance of ILogContext with the minimum log level set for the specified type.

WithTruncation(int?)

Sets the truncation length for log messages in the current context.

ILogContext WithTruncation(int? length)

Parameters

length int?

The maximum length of log messages before truncation occurs. Pass null to disable truncation.

Returns

ILogContext

The current instance of ILogContext with the truncation length set.