summaryrefslogtreecommitdiffhomepage
path: root/scripts/utils
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-07-15 11:45:51 +0200
committerOskar Nyberg <oskar@mullvad.net>2022-07-15 11:45:51 +0200
commit783a1c95bbb2d973df5e3b0b31e2258ae45853fc (patch)
treeccd5687432afcbbc0233553b13640566994ff184 /scripts/utils
parent9ba1ffe343ceed18674885dca1940ef403924433 (diff)
parentd20500a4cab06d7ae584799162423d9ff3f093c8 (diff)
downloadmullvadvpn-783a1c95bbb2d973df5e3b0b31e2258ae45853fc.tar.xz
mullvadvpn-783a1c95bbb2d973df5e3b0b31e2258ae45853fc.zip
Merge branch 'add-localization-helper-script'
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
+}