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

This commit is contained in:
AI Agent
2026-03-19 18:04:32 -06:00
parent 678543dd9a
commit ff220f6f3b
12 changed files with 153 additions and 129 deletions

View File

@@ -170,3 +170,30 @@ jobs:
grep -q '"shop"' rpc_resp.json
rm rpc_resp.json
./target/debug/mudtool -d "$TEST_DB" players delete rpctest
- name: Verify logging
run: |
if [ ! -d "logs" ]; then
echo "Error: logs directory not found"
exit 1
fi
if ! ls logs/mudserver_*.log >/dev/null 2>&1; then
echo "Error: no mudserver log files found"
exit 1
fi
if ! ls logs/combat_*.log >/dev/null 2>&1; then
echo "Error: no combat log files found"
exit 1
fi
MS_LOG=$(ls -t logs/mudserver_*.log | head -n 1)
CB_LOG=$(ls -t logs/combat_*.log | head -n 1)
echo "Checking mudserver log: $MS_LOG"
grep -q "World '.*': .* rooms" "$MS_LOG"
grep -q "MUD server listening on" "$MS_LOG"
grep -q "New character created: smoketest" "$MS_LOG"
grep -q "Admin action: registration setting updated: '.*'" "$MS_LOG"
echo "Checking combat log: $CB_LOG"
grep -q "Combat: Player 'smoketest' (ID .*) killed NPC 'Shadowy Thief'" "$CB_LOG"