absl::StatusBuilder::OnlyOutputToSink

Mutates the builder so that the result status will only be logged to the provided sink when this builder is converted to a status.

Synopsis

Declared in <absl/status/status_builder.h>

[[nodiscard]]
StatusBuilder&&
OnlyOutputToSink(absl::LogSink* sink) &&;

Description

Overwrites any sink set prior. The provided sink must point to a valid object by the time this builder is converted to a status. Has no effect if this builder is not configured to log by calling any of the LogXXX methods.

Return Value

*this to allow method chaining.

NOTE

The return value should not be discarded.

Parameters

NameDescription
sinkThe log sink to exclusively receive the result status.