Change logging depending on DEBUG