2024-01-14 18:43:11 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This script has been created as part of the Blueprint source code
|
2024-01-15 11:40:50 -05:00
|
|
|
# and uses the same license as the rest of the codebase.
|
2024-01-14 18:43:11 -05:00
|
|
|
|
|
|
|
PRINT() {
|
|
|
|
DATE=$(date +"%Y-%m-%d %H:%M:%S")
|
|
|
|
TYPE="$1"
|
|
|
|
MESSAGE="$2"
|
|
|
|
|
|
|
|
BOLD=$(tput bold)
|
|
|
|
RESET=$(tput sgr0)
|
2024-01-15 11:40:50 -05:00
|
|
|
SECONDARY="\033[2m"
|
2024-01-14 18:43:11 -05:00
|
|
|
|
|
|
|
if [[ $TYPE == "INFO" ]]; then PRIMARY=$(tput setaf 4); fi
|
|
|
|
if [[ $TYPE == "WARNING" ]]; then PRIMARY=$(tput setaf 3); fi
|
|
|
|
if [[ $TYPE == "FATAL" ]]; then PRIMARY=$(tput setaf 1); fi
|
|
|
|
if [[ $TYPE == "SUCCESS" ]]; then PRIMARY=$(tput setaf 2); fi
|
|
|
|
if [[ $TYPE == "INPUT" ]]; then PRIMARY=$(tput setaf 5); fi
|
|
|
|
|
|
|
|
echo -e "${BOLD}${SECONDARY}$DATE${RESET} ${PRIMARY}[${TYPE}]${RESET} $MESSAGE"
|
|
|
|
echo -e "${BOLD}${SECONDARY}$DATE${RESET} ${PRIMARY}[${TYPE}]${RESET} $MESSAGE" >> "$FOLDER"/.blueprint/extensions/blueprint/private/debug/logs.txt
|
|
|
|
}
|