Change logging to only be enabled in debug mode

This should aide in performance benefits when doing large populations (though the developer should still disable SQL logging as well).