What problem does it solve?
Developers building MoonBit agents on Golem need a consistent way to emit leveled, contextual log output that integrates with the platform's oplog and streaming tools, instead of relying on unstructured println statements.
Core Features & Use Cases
- Module-Level Logging: Call @logging.info, @logging.debug, @logging.warn, and @logging.error directly with no initialization required.
- Named Loggers with Context: Create scoped loggers via @logging.with_name("order-service") that build /-separated context strings passed to the WASI logging interface.
- Level Filtering: Set a global minimum level with @logging.set_min_level or per-logger overrides with with_min_level to suppress noisy trace/debug output.
- Use Case: While debugging a MoonBit order-processing agent, add a named logger per service module, set the global level to INFO in production, and stream live output with golem agent stream to trace failures.
Quick Start
Add logging to my MoonBit Golem agent using the @logging module with a named logger and info-level messages.