Added some logging functionality.