Don't generate compaction statistics if logging isn't enabled
patch by dbrosius reviewed by jbellis for cassandra-5262