Simplifying and improving debug mode logging