PostSharpAPI ReferencePost­Sharp.​Patterns.​DiagnosticsLogging­BackendGet­Source
Open sandboxFocus

LoggingBackend.GetSource Method

GetSource(String, Type)

Returns a LoggingTypeSource for the given role and type.

Declaration
public LoggingTypeSource GetSource(string role, Type type)
Parameters
Type Name Description
System.String role

The role. Typically one of the constants of the LoggingRoles type, or a custom role.

System.Type type

The type.

Returns
Type Description
LoggingTypeSource

The LoggingTypeSource for role and type. If no LoggingTypeSource exists for this role and type, this method shall create a new LoggingTypeSource.

GetSource(String, String)

Returns a LoggingNamespaceSource for the given role and, optionally, namespace.

Declaration
public LoggingNamespaceSource GetSource(string role, string ns = null)
Parameters
Type Name Description
System.String role

The role. Typically one of the constants of the LoggingRoles type, or a custom role.

System.String ns

The namespace for which the LoggingNamespaceSource is requested, or null if the LoggingNamespaceSource is requested for the root namespace.

Returns
Type Description
LoggingNamespaceSource

The LoggingNamespaceSource for role and ns. If no LoggingNamespaceSource exists for this role and type, this method shall create a new LoggingNamespaceSource.