Logger Utilities
Overview
The Logger utility provides a centralized, configurable logging system for your game. It’s automatically initialized by the Application during bootstrap based on your application configuration, so there’s no need to manually initialize it.
Logger Configuration
The logger mode is automatically set based on your application configuration (uses sensible defaults, but you can override it):
If needed, you can still modify the mode after initialization:
Logging Methods
Basic Logging
Trace Logging
Logger Modes
The Logger supports three modes that control how logging information is displayed:
Development Mode ('development'
)
Development mode provides the most detailed logging output, including stack traces in collapsible groups. This is ideal during development and debugging:
Benefits:
- Collapsible log groups for cleaner console output
- Automatic stack traces for easier debugging
- Full visibility into the call chain
- Automatically enabled in development environments unless overridden
Default Mode ('default'
)
Default mode provides basic logging with visual distinction between log types:
Benefits:
- Color-coded log messages for different types (log, warn, error)
- Cleaner output suitable for staging environments
- No stack traces for reduced console clutter
Disabled Mode ('disabled'
)
Disabled mode suppresses all logging output:
Benefits:
- Zero logging overhead in production
- Prevents sensitive information leakage
- Ideal for production builds