unify logging a bit and add the debug module