Skip to content

WrappingPrefixLogger(ILogger, Type) constructor

Defined in

Type: WrappingPrefixLogger Namespace: Splat Assembly: Splat.Logging.dll

Applies to

net11.0, net10.0, net47, net471, net472, net48, net481

public WrappingPrefixLogger(ILogger inner, Type callingType)

View source

Summary: Provides an ILogger implementation that prefixes all log messages with the name of a specified type, enabling easier identification of log sources.

Parameters

NameTypeDescription
inner[ILogger](#Splat.ILogger)The underlying ILogger instance to which log messages are forwarded. Cannot be null.
callingTypeTypeThe type whose name is used as a prefix for all log messages. Cannot be null.

Remarks

This logger is useful for scenarios where log output should be clearly associated with a particular class or component. All log messages written through this logger are automatically prefixed with the name of the provided type, followed by a colon and a space. This can help distinguish log entries in applications with multiple components sharing a common logging infrastructure.