PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics Namespace / Logger­Factory­Extensions Class / Logger­Factory­Extensions Methods / Logger­Factory­Extensions.​Get­Log­Source Method / Logger­Factory­Extensions.​Get­Log­Source Method (ILogger­Factory2, Type)

LoggerFactoryExtensions.GetLogSource Method (ILoggerFactory2, Type)

Note: This API is now obsolete.

Gets a LogSource for a given role and Type.

Namespace:  PostSharp.Patterns.Diagnostics
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 2023.0.3.0 (2023.0.3.0)
[ObsoleteAttribute("Provide an ILoggerFactory3.")]
public static LogSource GetLogSource(
	this ILoggerFactory2 factory,
	Type type


Type: PostSharp.Patterns.Diagnostics.Custom.ILoggerFactory2
An ILoggerFactory.
Type: System.Type
The type that will emit the records.

Return Value

Type: LogSource
A LogSource for type.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ILoggerFactory2. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also