Photomechanics API
Photomechanics.Photo3DStudio.Common.Extensions.SerilogExtensions Class Reference

Provides helper extensions to Serilog logging. More...

Static Public Member Functions

static LoggerConfiguration ByTransformingWithSubtypes< TValue > (this LoggerDestructuringConfiguration destructuringConfiguration, Func< TValue, Object > transformation)
 When destructuring objects, transform instances of the specified type with the provided function. Inheritance-aware. More...
 
static IDisposable SuppressLogging ()
 Get disposable token to suppress logging for context. More...
 
static Boolean IsSuppressed (this LogEvent logEvent)
 Determines whether the given log event suppressed. More...
 

Detailed Description

Provides helper extensions to Serilog logging.

Member Function Documentation

◆ ByTransformingWithSubtypes< TValue >()

static LoggerConfiguration Photomechanics.Photo3DStudio.Common.Extensions.SerilogExtensions.ByTransformingWithSubtypes< TValue > ( this LoggerDestructuringConfiguration  destructuringConfiguration,
Func< TValue, Object >  transformation 
)
static

When destructuring objects, transform instances of the specified type with the provided function. Inheritance-aware.

Parameters
destructuringConfigurationDestructuring configuration.
transformationFunction mapping instances of TValue to an alternative representation.
Template Parameters
TValueType of values to transform.
Returns
Configuration object allowing method chaining.
Exceptions
ArgumentNullException

◆ SuppressLogging()

static IDisposable Photomechanics.Photo3DStudio.Common.Extensions.SerilogExtensions.SuppressLogging ( )
static

Get disposable token to suppress logging for context.

Pushes "SuppressLogging" property with unique value to SerilogContext. When disposed, disposes Serilog property push token and invalidates stored value so new log messages are no longer suppressed.

◆ IsSuppressed()

static Boolean Photomechanics.Photo3DStudio.Common.Extensions.SerilogExtensions.IsSuppressed ( this LogEvent  logEvent)
static

Determines whether the given log event suppressed.

Also removes "SuppressLogging" property if present.