making log.d's optional