Bastion.Logger
lib/logger.march — Bastion.Logger
Thin wrapper over the March stdlib Logger.
The stdlib Logger handles level filtering, structured fields, and pluggable appenders. This module adds:
- Bastion's two-argument call convention: info(msg, meta)
where meta : List((String, String)) maps naturally to logfmt/json fields.
2. A configure/2 helper called by the Application supervisor to
wire up the appender and level from Config on startup.
3. _conn helpers that pull request_id from the Conn automatically.The stdlib Logger is always available as Logger; use it directly for advanced use cases (with_scope, with_span, add_appender, etc.).
Functions
Configure the stdlib Logger from application config. Call this once from Application.start() before any logging.
Bastion.Logger.configure(Config.log_level(), Config.log_format())Log at DEBUG level with optional key-value metadata.
Log at ERROR level with optional key-value metadata.
Log at INFO level with optional key-value metadata.
Parse a level string (case-insensitive). Defaults to Info on unknown input.
Log at WARN level with optional key-value metadata.