absl::AddLogSink

Adds a absl::LogSink as a consumer of logging data.

Synopsis

Declared in <absl/log/log_sink_registry.h>

void
AddLogSink(absl::LogSink* sink);

Description

This function is thread-safe.

It is an error to attempt to add a sink that's already registered.

To avoid unbounded recursion, dispatch to registered absl::LogSinks is disabled per-thread while running the Send() method of registered absl::LogSinks. Affected messages are dispatched to a special internal sink instead which writes them to stderr.

Do not call this inside absl::LogSink::Send.

Parameters

NameDescription
sinkThe sink to register.