Improve debug logging flexibility