I feel like there could be better solutions for debug printing than a global variable. In a future commit, consider using a callback-hook, or adding an optional-parameter to this function.