Expand description
The whole logging facade — sinks, the early-record ring, the throttle
primitives, init/flush/add_sink.
The root re-exports above are the surface a node author needs; this is everything, for a board or a bridge composing its own delivery.
Modules§
- early
- Records raised before any sink was installed.
- macros
- Phase 88.2 — the emission macros.
- pool
- phase-417 W4.d — bounded storage so
get_or_create_loggercan hand out a logger for a name nobody registered at compile time. - sinks
- Sinks the FACADE itself can offer.
- throttle
- phase-417 W4.d — rate-limited logging, on the
Loggereverything else uses.
Macros§
- log
- Emit one record at a severity chosen at RUNTIME — rclrs’s
log!. - log_
debug - Emit at
crate::Severity::Debug. - log_
error - Emit at
crate::Severity::Error. - log_
fatal - Emit at
crate::Severity::Fatal. - log_
info - Emit at
crate::Severity::Info. - log_
warn - Emit at
crate::Severity::Warn. - nros_
debug_ throttle - Emit at
crate::Severity::Debug, at most once perinterval_msat this call site. - nros_
debug_ throttle_ at - Emit at
crate::Severity::Debug, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - nros_
error_ throttle - Emit at
crate::Severity::Error, at most once perinterval_msat this call site. - nros_
error_ throttle_ at - Emit at
crate::Severity::Error, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - nros_
fatal_ throttle - Emit at
crate::Severity::Fatal, at most once perinterval_msat this call site. - nros_
fatal_ throttle_ at - Emit at
crate::Severity::Fatal, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - nros_
info_ throttle - Emit at
crate::Severity::Info, at most once perinterval_msat this call site. - nros_
info_ throttle_ at - Emit at
crate::Severity::Info, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - nros_
trace - Emit at
crate::Severity::Trace. - nros_
trace_ throttle - Emit at
crate::Severity::Trace, at most once perinterval_msat this call site. - nros_
trace_ throttle_ at - Emit at
crate::Severity::Trace, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies. - nros_
warn_ throttle - Emit at
crate::Severity::Warn, at most once perinterval_msat this call site. - nros_
warn_ throttle_ at - Emit at
crate::Severity::Warn, at most once perinterval_msat this call site, measured against thenow_nsthe CALLER supplies.
Structs§
- Format
Buffer - Stack-resident UTF-8 buffer for one log record’s formatted body.
- Logger
- A named logger with a runtime severity threshold.
- Record
- One log entry, handed to each
LogSink. - Throttle
State - Per-call-site throttle window.
Enums§
- Child
Error - Why
Logger::create_childmade no child — RFC-0102 D1. - Severity
- REP-2012 severity levels: rcutils’s five, in rcutils’s order, plus
Trace.
Constants§
- MAX_
ADDED_ SINKS - How many sinks
add_sinkcan append on top of theinitlist. - MAX_
LOGGERS - Maximum number of named loggers that can be registered via
register_logger. Beyond this,get_loggerreturnsDEFAULT_LOGGER. - MAX_
LOGGER_ NAME_ LEN - Longest logger name the arena will accept, in bytes.
Statics§
- DEFAULT_
LOGGER - Catch-all logger returned when the requested name is not registered (or the intern table is full).
Traits§
- LogSink
- Backend a log record is delivered to.
Functions§
- add_
sink - Append
sinkto the sinks every record is delivered to. - added_
sink_ count - How many sinks
add_sinkhas installed. - dynamic_
logger_ capacity - How many loggers
crate::get_or_create_loggermay create. - dynamic_
logger_ name_ arena - Bytes of the name arena spent, and its total size.
- dynamic_
loggers_ in_ use - How many of the
dynamic_logger_capacityslots are spent. - flush
- Flush every registered sink, appended ones included.
- format_
buffer_ capacity - Returns the configured capacity in bytes.
- get_
logger - Look up a registered logger by name. Returns
DEFAULT_LOGGERif none is registered (callregister_loggerfor a'static Loggerto publish one). - get_
or_ create_ logger - Look up a logger by name, CREATING one if the name is new.
- init
- Install the global sink list.
- interval_
ms_ to_ ns - Milliseconds to nanoseconds, saturating.
- register_
logger - Publish
loggerunder its name so subsequentget_loggercalls with that name return THIS reference. - resolve_
logger - Resolve
nameto a logger — the TOTAL form ofget_or_create_logger, and the one spelling every node-shaped accessor uses. - resolve_
node_ logger resolve_loggerfor a NODE’s own logger, marking it as one — the one spelling the node-shaped accessors use (Node::logger,rclc_node_get_logger, the C++ node’s), so the/rosoutsink can publish what upstream publishes (RFC-0102 D4). The catch-all is never marked: a node whose name fell back to it would otherwise publish every unnamed logger.- severity_
enabled_ at_ compile_ time - Compile-time ceiling check used by the
nros_*!macros. - severity_
from_ u8 - Reconstruct a
Severityfrom itsu8discriminant. - throttle_
decide - The whole rule, as a pure function. Both storages call this.
- timestamp_
available - Whether [
__timestamp_ns] can answer with a real clock.