pub struct PublishOptions<'t> { /* private fields */ }
Expand description
Options to configure publishing. This is for initialization of logs, it’s a superset of
PublisherOptions
.
Implementations§
Source§impl<'t> PublishOptions<'t>
impl<'t> PublishOptions<'t>
Sourcepub fn log_file_line_info(self, enable: bool) -> Self
pub fn log_file_line_info(self, enable: bool) -> Self
Whether or not to log file/line information regardless of severity.
Default: false.
Sourcepub fn listen_for_interest_updates(self, enable: bool) -> Self
pub fn listen_for_interest_updates(self, enable: bool) -> Self
When set, a fuchsia_async::Task
will be spawned and held that will be
listening for interest changes. This option can only be set if
register_global_logger
is set.
Default: true for PublishOptions
, false for PublisherOptions
.
Sourcepub fn use_log_sink(self, client: ClientEnd<LogSinkMarker>) -> Self
pub fn use_log_sink(self, client: ClientEnd<LogSinkMarker>) -> Self
Sets the LogSink
that will be used.
Default: the fuchsia.logger.LogSink
available in the incoming namespace.
Sourcepub fn blocking(self, is_blocking: bool) -> Self
pub fn blocking(self, is_blocking: bool) -> Self
When set to true, writes to the log socket will be blocking. This is, we’ll retry every time the socket buffer is full until we are able to write the log.
Default: false
Sourcepub fn register_global_logger(self, value: bool) -> Self
pub fn register_global_logger(self, value: bool) -> Self
When set to true, the publisher will be registered as the global logger. This can only be done once.
Default: true for PublishOptions
, false for PublisherOptions
.
Source§impl PublishOptions<'_>
impl PublishOptions<'_>
Sourcepub fn install_panic_hook(self, enable: bool) -> Self
pub fn install_panic_hook(self, enable: bool) -> Self
Whether or not to install a panic hook which will log an ERROR whenever a panic happens.
Default: true.
Sourcepub fn always_log_file_line(self) -> Self
pub fn always_log_file_line(self) -> Self
Enable to always log file/line information, otherwise only log when severity is ERROR or above.
Sourcepub fn panic_prefix(self, prefix: &'static str) -> Self
pub fn panic_prefix(self, prefix: &'static str) -> Self
Override the default string prefix for a logged panic message.
Source§impl<'t> PublishOptions<'t>
impl<'t> PublishOptions<'t>
Sets the tags applied to all published events.
When set to an empty slice (the default), events are tagged with the moniker of the component in which they are recorded.
Default: empty.
Sourcepub fn enable_metatag(self, metatag: Metatag) -> Self
pub fn enable_metatag(self, metatag: Metatag) -> Self
Enable a metatag. It’ll be applied to all published events.
Default: no metatags are enabled.
Sourcepub fn minimum_severity(self, severity: impl Into<Severity>) -> Self
pub fn minimum_severity(self, severity: impl Into<Severity>) -> Self
An interest filter to apply to messages published.
Default: EMPTY, which implies INFO.