Crate diagnostics_log

Source
Expand description

Provides the log::Log implementation that allows to publish log events to Fuchsia Logging System.

This library isn’t Fuchsia-specific and provides a general log::Log that allows the library to also be used in the host.

Macros§

log_every_n_seconds
Logs every N seconds using an Atomic variable to keep track of the time. This will have a higher performance impact on ARM compared to regular logging due to the use of an atomic.
paste

Structs§

BufferedPublisher
A buffered publisher will buffer log messages until the IOBuffer is received. If this is registered as the global logger, then messages will be logged at the default level until an updated level is received from Archivist.
PublishOptions
Options to configure publishing. This is for initialization of logs, it’s a superset of PublisherOptions.
Publisher
A Publisher acts as broker, implementing log::Log to receive log events from a component, and then forwarding that data on to a diagnostics service.
PublisherOptions
Options to configure a Publisher.
TestRecord
Arguments to create a record for testing purposes.

Enums§

Metatag
Tag derived from metadata.
PublishError
Errors arising while forwarding a diagnostics stream to the environment.
Severity
Severities a log message can have, often called the log’s “level”.

Traits§

OnInterestChanged
Callback for interest listeners
SeverityExt
A type which has a Severity.

Functions§

initialize
Initializes logging with the given options.
initialize_buffered
Initializes logging, but buffers logs until the connection is established. This is required for things like Component Manager, which would otherwise deadlock when starting. This carries some overhead, so should be avoided unless required.
initialize_sync
Initializes logging with the given options.
set_minimum_severity
Sets the global minimum log severity. IMPORTANT: this function can panic if initialize wasn’t called before.