Logging¶
happy-simulator is silent by default. Enable logging explicitly.
Console Logging¶
File Logging¶
happysimulator.enable_file_logging("sim.log", max_bytes=10_000_000)
happysimulator.enable_timed_file_logging("sim.log")
JSON Logging¶
happysimulator.enable_json_logging() # to console
happysimulator.enable_json_file_logging("sim.json") # to file
Environment Variables¶
| Variable | Description |
|---|---|
HS_LOGGING |
Log level (DEBUG, INFO, WARNING, ERROR) |
HS_LOG_FILE |
Log file path |
HS_LOG_JSON |
Set to 1 for JSON format |
Module-Level Control¶
Disabling¶
Next Steps¶
- Testing Patterns — debugging with deterministic simulations
- Visual Debugger — browser-based log viewer