Added Logging and Tests for Logging.