Add logging and test example