Implement robust logging with flexi_logger and update CI to verify logs
This commit is contained in:
@@ -170,3 +170,23 @@ 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 log files found"
|
||||
exit 1
|
||||
fi
|
||||
LOG_FILE=$(ls -t logs/mudserver_*.log | head -n 1)
|
||||
echo "Checking log file: $LOG_FILE"
|
||||
grep -q "World '.*': .* rooms" "$LOG_FILE"
|
||||
grep -q "MUD server listening on" "$LOG_FILE"
|
||||
grep -q "New character created: smoketest" "$LOG_FILE"
|
||||
grep -q "Admin action: registration setting updated: '.*'" "$LOG_FILE"
|
||||
grep -q "Combat: Player 'smoketest' (ID .*) killed NPC 'Shadowy Thief'" "$LOG_FILE"
|
||||
grep -q "New character created: rpctest" "$LOG_FILE"
|
||||
grep -q "New JSON-RPC connection from" "$LOG_FILE"
|
||||
|
||||
Reference in New Issue
Block a user