only log debug state in debug mode