summaryrefslogtreecommitdiffhomepage
path: root/scripts/utils
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/utils')
-rw-r--r--scripts/utils/log32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/utils/log b/scripts/utils/log
new file mode 100644
index 0000000000..101ed9c5a5
--- /dev/null
+++ b/scripts/utils/log
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+# This is a logging tool for bash scripts
+
+function log {
+ local NO_COLOR="0m"
+ local msg=$1
+ local color=${2:-"$NO_COLOR"}
+ echo -e "\033[$color$msg\033[$NO_COLOR"
+}
+
+function log_header {
+ local YELLOW="33m"
+ echo ""
+ log "### $1 ###" $YELLOW
+ echo ""
+}
+
+function log_success {
+ local GREEN="32m"
+ log "$1" $GREEN
+}
+
+function log_error {
+ local RED="31m"
+ log "!! $1" $RED
+}
+
+function log_info {
+ local BOLD="1m"
+ log "$1" $BOLD
+}