Make logging conditional on an environment variable