appendContext

@CanIgnoreReturnValue()
public static StringBuilder appendContext(MetadataProcessor metadataProcessor, MetadataHandler<FloggerMetadataKey.KeyValueHandler> metadataHandler, StringBuilder buffer)

Appends formatted context information to the given buffer using the supplied metadata handler. A custom metadata handler is useful if the logger backend wishes to:

  • Ignore more than just the default set of metadata keys (currently just the "cause").
  • Intercept and capture metadata values for additional processing or logging control.

Return

the given destination buffer (for method chaining).

Parameters

metadataProcessor

snapshot of the metadata to be processed (MetadataProcessor is reusable so passing one in can save repeated processing of the same metadata).

metadataHandler

a metadata handler for intercepting and dispatching metadata during formatting.

buffer

destination buffer into which the log message and metadata will be appended.