VisitProperties<TState>(ILoggingPropertyVisitor<TState>, ref TState, in LoggingPropertyVisitorOptions)
Invokes the Visit<TValue>(string, TValue, in LoggingPropertyOptions, ref TState) method of an interface implementation for each property on the current record, but not in the context stack.
Declaration
public void VisitProperties<TState>(ILoggingPropertyVisitor<TState> visitor, ref TState state, in LoggingPropertyVisitorOptions options = default)
Parameters
Type | Name | Description |
---|---|---|
ILoggingPropertyVisitor<TState> | visitor | The visitor implementation. |
TState | state | The opaque state passed through to the visitor. |
LoggingPropertyVisitorOptions | options | Determines which properties are visited. |
Type Parameters
Name | Description |
---|---|
TState | The type of the opaque state passed through to the visitor. |
VisitProperties(Action<string, object>, in LoggingPropertyVisitorOptions)
Invokes a delegate each property on the current log record. This offers a simple way to visit properties, but it has a performance overhead compared to VisitProperties<TState>(ILoggingPropertyVisitor<TState>, ref TState, in LoggingPropertyVisitorOptions) because it is weakly typed and cause the allocation of a closure class to build the action. It also does not expose the LoggingPropertyOptions.
Declaration
public void VisitProperties(Action<string, object> action, in LoggingPropertyVisitorOptions options = default)
Parameters
Type | Name | Description |
---|---|---|
Action<string, object> | action | The delegate to call for each property. The first value is the property name, the second its value. |
LoggingPropertyVisitorOptions | options | Determines which properties are visited. |