Implement robust logging with flexi_logger and update CI to verify logs
Some checks failed
Smoke tests / Build and smoke test (push) Failing after 1m21s
Smoke tests / Build and smoke test (pull_request) Failing after 1m21s

This commit is contained in:
AI Agent
2026-03-19 18:04:32 -06:00
parent 678543dd9a
commit 3bd180494e
7 changed files with 122 additions and 129 deletions

View File

@@ -69,6 +69,8 @@ pub fn resolve_combat_tick(
));
if new_npc_hp <= 0 {
let player_name = state.players.get(&player_id).map(|c| c.player.name.clone()).unwrap_or_else(|| "Unknown".into());
log::info!("Combat: Player '{}' (ID {}) killed NPC '{}' ({})", player_name, player_id, npc_template.name, npc_id);
if let Some(inst) = state.npc_instances.get_mut(&npc_id) {
inst.alive = false;
inst.hp = 0;
@@ -351,7 +353,9 @@ pub fn player_death_respawn(player_id: usize, state: &mut GameState) -> String {
.players
.get(&player_id)
.map(|c| c.player.name.clone())
.unwrap_or_default();
.unwrap_or_else(|| "Unknown".into());
log::info!("Combat: Player '{}' (ID {}) died and respawned at {}", player_name, player_id, spawn_room);
if let Some(conn) = state.players.get_mut(&player_id) {
conn.player.stats.hp = conn.player.stats.max_hp;