Enable logging only on DEBUG mode