Added logging for the main program loop

(see #7)