Add logging and ability to set custom logger