Alpha. Vary is under active development and not ready for production use. Syntax, APIs, performance, and behaviour may change between releases.
Logging
Control log output and capture events for testing:
import log
log.set_level("DEBUG")
log.set_sink("stderr")
# Capture log events for testing
log.capture()
# ... code that logs ...
let events = log.events()
| Function | Returns | Description |
|---|---|---|
log.set_level(level) | None | Set log level: "DEBUG", "INFO", "WARN", "ERROR" |
log.set_sink(sink) | None | Set sink: "stdout", "stderr", or a file path |
log.capture() | None | Start capturing log events |
log.events() | List[Str] | Stop capturing and return captured events |