Added logging classes

- also fixed a unit test memory leak