Assist_Design/scripts/set-log-level.sh
T. Narantuya 0f7d680782 Update throttler configuration and enhance logging setup
- Adjusted authentication rate limit TTL from 15 minutes to 10 minutes for stricter control.
- Improved logging configuration to reduce noise by ignoring specific HTTP requests and customizing serializers.
- Refactored logging in checkout components to utilize useCallback for better performance and removed unnecessary console logs.
2025-09-01 18:47:30 +09:00

44 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Script to easily change log levels
# Usage: ./scripts/set-log-level.sh [error|warn|info|debug|trace]
if [ $# -eq 0 ]; then
echo "Current LOG_LEVEL: $(grep LOG_LEVEL .env | cut -d'=' -f2 | tr -d '"')"
echo ""
echo "Usage: $0 [error|warn|info|debug|trace]"
echo ""
echo "Log Levels:"
echo " error - Only errors (least verbose)"
echo " warn - Warnings and errors"
echo " info - General information (recommended)"
echo " debug - Detailed debugging info"
echo " trace - Very detailed tracing (most verbose)"
exit 0
fi
LEVEL=$1
# Validate log level
case $LEVEL in
error|warn|info|debug|trace)
;;
*)
echo "Invalid log level: $LEVEL"
echo "Valid levels: error, warn, info, debug, trace"
exit 1
;;
esac
# Update .env file
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
sed -i '' "s/LOG_LEVEL=\".*\"/LOG_LEVEL=\"$LEVEL\"/" .env
else
# Linux
sed -i "s/LOG_LEVEL=\".*\"/LOG_LEVEL=\"$LEVEL\"/" .env
fi
echo "✅ Log level changed to: $LEVEL"
echo "🔄 Restart your development server to apply changes"