Bunch of changes; renaming the ConfigBackup; you kinda suck

This commit is contained in:
2022-09-12 20:46:56 +03:00
parent 0f2a754e17
commit ea3d2b76b5
4 changed files with 31 additions and 22 deletions

10
Okiru
View File

@@ -78,21 +78,21 @@ logging () {
}
#Debugging level logging; can be toggled via a switch
debug () {
printf "${BLUE}[DEBUG]: $1${STOP}\n" > /dev/stdout
printf "${BLUE}[DEBUG]: $1${STOP}\n"
if [[ -f $LOG ]]; then
echo -e "$(date | awk '{print $4}') [DEBUG]: $1" >> $LOG
fi
}
#Information level logging;
info () {
printf "${CYAN}[INFO]:${STOP} $1\n" > /dev/stdout
printf "${CYAN}[INFO]:${STOP} $1\n"
if [[ -f $LOG ]]; then
echo -e "$(date | awk '{print $4}') [INFO]: $1" >> $LOG
fi
}
#Warning level logging;
warn () {
printf "${YELLOW}[WARNING]:${STOP} $1\n" > /dev/stdout
printf "${YELLOW}[WARNING]:${STOP} $1\n"
if [[ -f $LOG ]]; then
echo -e "$(date | awk '{print $4}') [WARN]: $1" >> $LOG
fi
@@ -101,7 +101,7 @@ warn () {
error () {
echo $1 1>&2
# ` ^ Output error message to stderr
printf "${RED}[ERROR]: $1${STOP}\n" > /dev/stdout
printf "${RED}[ERROR]: $1${STOP}\n"
# ^ Print it to the screen
errors+=("$1")
# ^ And add to errors array
@@ -116,7 +116,7 @@ error () {
return 1
}
ok () {
printf "${GREEN}[SUCCESS]: $1${STOP}\n" > /dev/stdout
printf "${GREEN}[SUCCESS]: $1${STOP}\n"
if [[ -f $LOG ]]; then
echo -e "$(date | awk '{print $4}') [SUCCESS]: $1" >> $LOG
fi