Add rudimentary logging and debug