Implement logger (WIP, untested)