PostSharpAPI ReferencePost­Sharp.​Patterns.​DiagnosticsLoggerGet­Logger
Open sandboxFocus

Logger.GetLogger Method

GetLogger(String, Type)

Gets a Logger for a given role and System.Type.

Declaration
public static Logger GetLogger(string role, Type type)
Parameters
Type Name Description
System.String role

The role name (see LoggingRoles for a list of standard logging roles).

System.Type type

The type that will emit the records.

Returns
Type Description
Logger

A Logger for role and type.

GetLogger(String)

Gets a Logger for a given role and for the calling type.

Declaration
public static Logger GetLogger(string role = "Custom")
Parameters
Type Name Description
System.String role

The role name (see LoggingRoles for a list of standard logging roles). The default value is Custom.

Returns
Type Description
Logger

A Logger for role and the calling type.

GetLogger(String, ref CallerInfo)

Declaration
public static Logger GetLogger(string role, ref CallerInfo callerInfo)
Parameters
Type Name Description
System.String role
CallerInfo callerInfo
Returns
Type Description
Logger