fss-mini-rag-github/logs/log_functions.sh
fss-code-server 12446808c1 Agent 09 Test Results: Construction Safety - OSHA Compliance Testing
- Successfully tested FSS-Mini-RAG with construction safety management documentation
- Created comprehensive knowledge base with 5 OSHA standards documents
- Executed 5 search queries with excellent relevance and performance
- Documented zero issues found - system functioned perfectly
- Overall effectiveness rating: 8/10 for construction safety professionals

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-08 15:57:40 +00:00

39 lines
1.6 KiB
Bash

#!/bin/bash
AGENT_ID=$(basename $(pwd | xargs dirname) | cut -d'_' -f1)
log_message() {
local level=$1
local phase=$2
local message=$3
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [AGENT-${AGENT_ID}] [$phase] [$level] $message" >> logs/agent_${AGENT_ID}_session.log
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$phase] [$level] $message"
if [ "$level" = "ERROR" ]; then
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [AGENT-${AGENT_ID}] [$phase] $message" >> logs/agent_${AGENT_ID}_errors.log
fi
}
update_progress() {
local phase=$1
local percentage=$2
jq --arg phase "$phase" --arg pct "$percentage" --arg time "$(date -Iseconds)" \
'.current_phase = $phase | .progress_percentage = ($pct | tonumber) | .last_update = $time' \
logs/agent_${AGENT_ID}_progress.json > logs/agent_${AGENT_ID}_progress.tmp && \
mv logs/agent_${AGENT_ID}_progress.tmp logs/agent_${AGENT_ID}_progress.json
}
log_gitea() {
local operation=$1
local details=$2
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [AGENT-${AGENT_ID}] [GITEA] $operation: $details" >> logs/agent_${AGENT_ID}_gitea.log
log_message "INFO" "GITEA" "$operation: $details"
}
mark_complete() {
local rating=$1
jq --arg time "$(date -Iseconds)" --arg rating "$rating" \
'.status = "completed" | .progress_percentage = 100 | .current_phase = "COMPLETE" | .overall_rating = ($rating | tonumber) | .last_update = $time' \
logs/agent_${AGENT_ID}_progress.json > logs/agent_${AGENT_ID}_progress.tmp && \
mv logs/agent_${AGENT_ID}_progress.tmp logs/agent_${AGENT_ID}_progress.json
}