absl::Status::ToString

Returns a string based on the mode.

Synopsis

Declared in <absl/status/status.h>

std::string
ToString(StatusToStringMode mode = StatusToStringMode::kDefault) const;

Description

By default, it returns combination of the error code name, the message and any associated payload messages. This string is designed simply to be human readable and its exact format should not be load bearing. Do not depend on the exact format of the result of ToString() which is subject to change.

The printed code name and the message are generally substrings of the result, and the payloads to be printed use the status payload printer mechanism (which is internal).

Return Value

A human-readable representation of the status.

Parameters

NameDescription
modeControls which extra data is included in the output.