Added some basic logging. Work in progress.