PostSharp6.1/API Reference/Post­Sharp.​Patterns.​Diagnostics.​Custom Namespace/ILogger Interface

ILogger Interface

Abstraction of the Logging facility, through which other components emit their log records. This interfaces abstracts other PostSharp components from the PostSharp.Patterns.Diagnostics component.

Namespace:  PostSharp.Patterns.Diagnostics.Custom
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.1.23.0 (6.1.23.0)
Syntax
C#
public interface ILogger

The ILogger type exposes the following members.

Properties
  NameDescription
Public propertyActivityOptions
Gets the default verbosity when opening and closing activities.
Public propertyRequiresSuspendResume
Determines whether calls of SuspendActivity(ILoggingContext, CallerInfo) and ResumeActivity(ILoggingContext, CallerInfo) is required for asynchronous custom activities in the current context.
Public propertyRole
Gets the role of records created by this ILogger. A list of standard roles is available in the LoggingRoles class.
Public propertyType
Gets the source Type for which this ILogger was created.
Methods
  NameDescription
Public methodIsEnabled
Determines whether logging is enabled for a given LogLevel.
Public methodOpenActivity
Opens an activity.
Public methodResumeActivity
Resumes an asynchronous activity suspended by the SuspendActivity(ILoggingContext, CallerInfo) method.
Public methodSetWaitDependency
Sets the wait dependency for a given context, i.e. give information about what the given context is waiting (or awaiting) for.
Public methodSuspendActivity
Suspends an asynchronous activity, which can then be resumed by the ResumeActivity(ILoggingContext, CallerInfo) method.
Public methodWrite(ILoggingContext, LogLevel, LogRecordKind, String, Exception, CallerInfo)
Writes a custom log record with a description without parameters.
Public methodWrite(ILoggingContext, LogLevel, LogRecordKind, String, Object[], Exception, CallerInfo)
Writes a custom log record with a description with an array of parameters.
Public methodWrite<T1>(ILoggingContext, LogLevel, LogRecordKind, String, T1, Exception, CallerInfo)
Writes a custom log record with 1 parameter.
Public methodWrite<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(ILoggingContext, LogLevel, LogRecordKind, String, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Exception, CallerInfo)
Writes a custom log record with 10 parameters.
Public methodWrite<T1, T2>(ILoggingContext, LogLevel, LogRecordKind, String, T1, T2, Exception, CallerInfo)
Writes a custom log record with 2 parameters.
Public methodWrite<T1, T2, T3>(ILoggingContext, LogLevel, LogRecordKind, String, T1, T2, T3, Exception, CallerInfo)
Writes a custom log record with 3 parameters.
Public methodWrite<T1, T2, T3, T4>(ILoggingContext, LogLevel, LogRecordKind, String, T1, T2, T3, T4, Exception, CallerInfo)
Writes a custom log record with 4 parameters.
Public methodWrite<T1, T2, T3, T4, T5>(ILoggingContext, LogLevel, LogRecordKind, String, T1, T2, T3, T4, T5, Exception, CallerInfo)
Writes a custom log record with 5 parameters.
Public methodWrite<T1, T2, T3, T4, T5, T6>(ILoggingContext, LogLevel, LogRecordKind, String, T1, T2, T3, T4, T5, T6, Exception, CallerInfo)
Writes a custom log record with 6 parameters.
Public methodWrite<T1, T2, T3, T4, T5, T6, T7>(ILoggingContext, LogLevel, LogRecordKind, String, T1, T2, T3, T4, T5, T6, T7, Exception, CallerInfo)
Writes a custom log record with 7 parameters.
Public methodWrite<T1, T2, T3, T4, T5, T6, T7, T8>(ILoggingContext, LogLevel, LogRecordKind, String, T1, T2, T3, T4, T5, T6, T7, T8, Exception, CallerInfo)
Writes a custom log record with 8 parameters.
Public methodWrite<T1, T2, T3, T4, T5, T6, T7, T8, T9>(ILoggingContext, LogLevel, LogRecordKind, String, T1, T2, T3, T4, T5, T6, T7, T8, T9, Exception, CallerInfo)
Writes a custom log record with 9 parameters.
Remarks

If you want to implement this interface, you should also implement the ILoggerFactory interface and register it to the ServiceLocator.

See Also