Move logging to modules