Assist_Design/scripts/set-log-level.sh
tema 9c796f59da Enhance Freebit integration and improve error handling
- Added FreebitMapperService to facilitate account normalization and improve code organization.
- Updated FreebitAuthService to streamline error handling and response parsing, replacing custom exceptions with standard error messages.
- Enhanced FreebitClientService to ensure proper URL construction and improved logging for API errors.
- Refactored FreebitOperationsService to include new request types and validation, ensuring better handling of SIM operations.
- Updated FreebitOrchestratorService to utilize the new mapper for account normalization across various methods.
- Improved SIM management features in the portal, including better handling of SIM details and usage information.
- Refactored components to enhance user experience and maintainability, including updates to the ChangePlanModal and SimActions components.
2025-11-21 18:41:14 +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"