2.8 KiB
name, group, category, update-time, description, key-word
| name | group | category | update-time | description | key-word | ||||
|---|---|---|---|---|---|---|---|---|---|
| library-logger-info | api | facade | 20260613 | Emit an info-level record through a LibraryLogger facade by delegating to the wrapped logger's info shortcut. |
|
Library-logger-info
Emit an info-level record through the library-facing sync logger. This is the convenience wrapper for log(Level::Info, ...) on LibraryLogger[S].
Interface
pub fn[S : Sink] LibraryLogger::info(
self : LibraryLogger[S],
message : String,
fields~ : Array[Field] = [],
) -> Unit {
input
self : LibraryLogger[S]- Library-facing logger that should emit the info record.message : String- Informational message text.fields : Array[Field]- Optional structured fields attached to the record.
output
Unit- No return value. The record is handled according to the current threshold and wrapped sink pipeline.
Explanation
Detailed rules explaining key parameters and behaviors
- This helper delegates to
info(...)on the wrapped logger, which in turn useslog(Level::Info, ...). Infois the default minimum logger threshold unless changed explicitly.- Per-call target override is not exposed here; use
log(...)if needed. - Any existing sink wrappers inside the logger pipeline still participate normally in the write path.
- The library facade keeps the same write semantics while exposing a smaller public surface.
- Broader composition helpers remain on the underlying
Logger[S]and requireto_logger()first.
How to Use
Here are some specific examples provided.
When Emit Normal Library Lifecycle Events
When a package should report standard lifecycle milestones:
logger.info("service started")
In this example, the event uses normal informational severity through the narrower facade.
When Attach Structured Informational Context
When an info event should include machine-readable metadata:
logger.info("request completed", fields=[field("status", "200")])
In this example, the event remains concise while still carrying useful fields.
And any shared context already carried by the facade still participates through the wrapped logger pipeline.
Error Case
e.g.:
-
If the logger minimum level is above
Info, the call returns without writing a record. -
If the event needs an explicit alternate target, use
log(...)instead of this shortcut. -
If callers need broader composition helpers after logging, they must unwrap first with
to_logger().
Notes
-
This is the common convenience method for normal library-facing events.
-
Because
Infois often the default threshold, this helper is a natural baseline for facade examples. -
Use
log(...)instead when the call site needs a per-call target override or a dynamic level.