

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 9
click for more info
Not enough gems
Cost: 6 gems
1: Data Serialization
incomplete
2: Game Logs
incomplete
3: Consume Logs
incomplete
4: Schema
incomplete
This lesson's interactive features are locked, please to keep using them
In the Peril game, occasionally we want to "log" a game event. Those logs should go to a central location where they can be inspected later. It's common in large backend systems to print logs to stdout or stderr, but to also send logs to a central logging system or database.
Whenever "war" events happen, we want to log them. For now, let's just add the functionality to publish them, and we'll let the messages pile up in the logs queue.
"{winner} won a war against {loser}"."{winner} won a war against {loser}"."A war between {attacker} and {defender} resulted in a draw".You should be able to verify in the RabbitMQ management UI that a log was published to the game_logs queue.
Run and submit the CLI tests.
You can remove those console.log we added to the subscribeJSON early on in the course.