fix logger, add tests