summaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-07-13 08:36:55 +0200
committerOskar Nyberg <oskar@mullvad.net>2022-07-15 10:12:16 +0200
commit99a872e5612c69022e269adfeb94381a6703de00 (patch)
tree2c816e5d1cff14454f85c86bb6b66cacae283ea1 /scripts
parent9ba1ffe343ceed18674885dca1940ef403924433 (diff)
downloadmullvadvpn-99a872e5612c69022e269adfeb94381a6703de00.tar.xz
mullvadvpn-99a872e5612c69022e269adfeb94381a6703de00.zip
Move build.sh logging functions to separate file
Diffstat (limited to 'scripts')
-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
+}