Tidy up console output for logging and rename `debug` to `test`