Implement robust logging with flexi_logger and update CI to verify logs
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user