style: format code with gofmt
This commit is contained in:
@@ -154,7 +154,7 @@ tail -f logs/mev_bot.log | while read line; do
|
||||
|
||||
# Extract reject reason (at the end for context)
|
||||
if echo "$line" | grep -oP 'rejectReason:[^]]+' &>/dev/null; then
|
||||
REASON=$(echo "$line" | grep -oP 'rejectReason:[^ ]+ [^ ]+ [^ ]+ [^ ]+ [^ ]+ [^ ]+' | cut -d: -f2)
|
||||
REASON=$(echo "$line" | grep -oP 'rejectReason:\K[^}]+' | head -c 200)
|
||||
# Trim to just the meaningful part (remove trailing field names)
|
||||
REASON=$(echo "$REASON" | sed 's/ token[0-9].*$//' | sed 's/ protocol.*$//' | sed 's/ poolAddress.*$//')
|
||||
echo -e "${RED} ❌ Reason: $REASON${NC}"
|
||||
@@ -220,19 +220,19 @@ tail -f logs/mev_bot.log | while read line; do
|
||||
echo -e "${RED}[$TIMESTAMP] ❌ ERROR #$ERRORS${NC}"
|
||||
fi
|
||||
|
||||
# IMPROVED: Extract error message using multiple patterns
|
||||
# IMPROVED: Extract error message using multiple patterns (CRITICAL FIX: removed truncation)
|
||||
# Try pattern 1: "error:" or "error="
|
||||
ERROR_MSG=$(echo "$line" | grep -oP 'error[=:].*' | head -c 100)
|
||||
ERROR_MSG=$(echo "$line" | grep -oP 'error[=:]\s*\K[^|]*' | head -c 300)
|
||||
|
||||
# Try pattern 2: Extract message after [ERROR] or [WARN] tag
|
||||
# Try pattern 2: Extract message after [ERROR] or [WARN] tag (CRITICAL FIX: increased limit to 300)
|
||||
if [[ -z "$ERROR_MSG" ]]; then
|
||||
ERROR_MSG=$(echo "$line" | sed -n 's/.*\[ERROR\]\s*//p' | sed -n 's/.*\[WARN\]\s*//p' | head -c 100)
|
||||
ERROR_MSG=$(echo "$line" | sed -n 's/.*\[ERROR\]\s*//p' | sed -n 's/.*\[WARN\]\s*//p' | head -c 300)
|
||||
fi
|
||||
|
||||
# Try pattern 3: Extract everything after timestamp and log level
|
||||
# Try pattern 3: Extract everything after timestamp and log level (CRITICAL FIX: increased limit to 300)
|
||||
if [[ -z "$ERROR_MSG" ]]; then
|
||||
# Format: "2025/11/02 20:19:03 [ERROR] message"
|
||||
ERROR_MSG=$(echo "$line" | sed -E 's/^[0-9]{4}\/[0-9]{2}\/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} \[(ERROR|WARN)\] //' | head -c 100)
|
||||
ERROR_MSG=$(echo "$line" | sed -E 's/^[0-9]{4}\/[0-9]{2}\/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} \[(ERROR|WARN)\] //' | head -c 300)
|
||||
fi
|
||||
|
||||
# Display error message if extracted
|
||||
|
||||
Reference in New Issue
Block a user