Added in logging tests. Refactoring to ensure logging actually works!