Introduce a log.hxx. Move logic from main to a game class.