added a logger abstraction, close #1