31 lines
996 B
Bash
Executable File
31 lines
996 B
Bash
Executable File
#!/bin/bash
|
|
# Console.log Cleanup Helper Script
|
|
# This script helps identify and replace console statements with logger utility
|
|
|
|
set -e
|
|
|
|
SRC_DIR="src"
|
|
LOG_FILE="console-cleanup.log"
|
|
|
|
echo "Console.log Cleanup Analysis" > "$LOG_FILE"
|
|
echo "=============================" >> "$LOG_FILE"
|
|
echo "" >> "$LOG_FILE"
|
|
|
|
# Find all console statements
|
|
echo "Finding all console statements..." | tee -a "$LOG_FILE"
|
|
grep -rn "console\." "$SRC_DIR" --include="*.ts" --include="*.tsx" | tee -a "$LOG_FILE"
|
|
|
|
echo "" >> "$LOG_FILE"
|
|
echo "Summary:" >> "$LOG_FILE"
|
|
echo "Total console statements found: $(grep -r "console\." "$SRC_DIR" --include="*.ts" --include="*.tsx" | wc -l)" >> "$LOG_FILE"
|
|
|
|
echo ""
|
|
echo "Analysis complete. Results saved to $LOG_FILE"
|
|
echo ""
|
|
echo "Next steps:"
|
|
echo "1. Review the log file"
|
|
echo "2. Replace console.log with logger.info (dev only)"
|
|
echo "3. Replace console.error with logger.error"
|
|
echo "4. Replace console.warn with logger.warn"
|
|
echo "5. Remove debug console.log statements"
|