print log only when debug=True