Module sink

Source
Expand description

Provides sinks to flexibly output log messages to specified targets.

§Sink

Sinks are the objects that actually write logs to their targets. Each sink should be responsible for only single target (e.g file, console, database), and each sink has its own private instance of Formatter object.

A sink has its own level filter that is not shared with the logger, and a Logger can combine multiple Sinks.

§Combined sink

A combined sink is also a sink, but instead of having its own target and formatter, it combines other sinks (as sub-sinks).

Operations on a combined sink will be forwarded to its sub-sinks according to the implementation.

Structs§

AsyncPoolSinkmulti-thread
A combined sink, logging and flushing asynchronously (thread-pool-based).
AsyncPoolSinkBuildermulti-thread
DedupSink
A combined sink, skip consecutive repeated records.
DedupSinkBuilder
FileSink
A sink with a file as the target.
FileSinkBuilder
JournaldSinkLinux and native and libsystemd
A sink with systemd-journal as the target.
JournaldSinkBuilderLinux and native and libsystemd
RotatingFileSink
A sink with a file as the target, split files according to the rotation policy.
RotatingFileSinkBuilder
StdStreamSink
A sink with a std stream as the target.
StdStreamSinkBuilder
WinDebugSinkWindows and native
A sink with a win32 API OutputDebugStringW as the target.
WinDebugSinkBuilderWindows and native
WriteSink
A sink that writes log messages into an arbitrary impl Write object.
WriteSinkBuilder

Enums§

OverflowPolicymulti-thread
Overflow policy for asynchronous sinks.
RotationPolicy
Rotation policies for RotatingFileSink.
StdStream
An enum representing the available standard streams.

Traits§

Sink
Represents a sink

Type Aliases§

Sinks
Container type for Sinks.