Improve debug logs

This allows enabling debug logs per a compilation unit or via
compilation time defines.
Merge pull request #207 from rainemak/debugLogImprovement

Improve debug logs