Debug features

- Enable debug features when in debug mode
- Optimize debug out when in production mode