LoggerFactoryExtensions.CreateLogger 方法

定义

重载

CreateLogger(ILoggerFactory, Type)

使用给定 type 的全名创建一个新的 ILogger 实例。

CreateLogger<T>(ILoggerFactory)

使用给定类型的全名创建一个新的 ILogger 实例。

CreateLogger(ILoggerFactory, Type)

Source:
LoggerFactoryExtensions.cs
Source:
LoggerFactoryExtensions.cs
Source:
LoggerFactoryExtensions.cs

使用给定 type 的全名创建一个新的 ILogger 实例。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILogger ^ CreateLogger(Microsoft::Extensions::Logging::ILoggerFactory ^ factory, Type ^ type);
public static Microsoft.Extensions.Logging.ILogger CreateLogger (this Microsoft.Extensions.Logging.ILoggerFactory factory, Type type);
static member CreateLogger : Microsoft.Extensions.Logging.ILoggerFactory * Type -> Microsoft.Extensions.Logging.ILogger
<Extension()>
Public Function CreateLogger (factory As ILoggerFactory, type As Type) As ILogger

参数

factory
ILoggerFactory

工厂。

type
Type

类型。

返回

所创建的 ILogger

适用于

CreateLogger<T>(ILoggerFactory)

Source:
LoggerFactoryExtensions.cs
Source:
LoggerFactoryExtensions.cs
Source:
LoggerFactoryExtensions.cs

使用给定类型的全名创建一个新的 ILogger 实例。

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILogger<T> ^ CreateLogger(Microsoft::Extensions::Logging::ILoggerFactory ^ factory);
public static Microsoft.Extensions.Logging.ILogger<T> CreateLogger<T> (this Microsoft.Extensions.Logging.ILoggerFactory factory);
static member CreateLogger : Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.Extensions.Logging.ILogger<'T>
<Extension()>
Public Function CreateLogger(Of T) (factory As ILoggerFactory) As ILogger(Of T)

类型参数

T

类型。

参数

factory
ILoggerFactory

工厂。

返回

ILogger<T>

所创建的 ILogger

适用于