Experimenting with logging instead of printing out messages