Implemented LogHandler

Custom log handling is usefull for testing.