Fix logs to only occur when debugging is YES (close #138)