From 0a30cd074b89a862769ff5063964a8ef5a1b8aa1 Mon Sep 17 00:00:00 2001 From: apolopena <3060702+apolopena@users.noreply.github.com> Date: Tue, 30 Mar 2021 11:39:54 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20https://github.com/apolop?= =?UTF-8?q?ena/gitpod-laravel8-starter/issues/82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/workspace-init-log.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 bash/workspace-init-log.sh diff --git a/bash/workspace-init-log.sh b/bash/workspace-init-log.sh new file mode 100644 index 00000000..79c0285c --- /dev/null +++ b/bash/workspace-init-log.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# workspace-init-logger.sh +# Description: +# Log wrapper for logging to workspace-init.log +# +# Usage: +# . workspace-init-logger +# log "SUCCESS: Logging to workspace-init.log" +# log "ERROR: something went wrong" - e + +# Log to the console and a file +log () { + if [ -z "$2" ]; then + bash bash/utils.sh log "$1" /var/log/workspace-init.log + else + bash bash/utils.sh log "$1" /var/log/workspace-init.log -e + fi +} + +# Log only to a file +log_silent () { + if [ -z "$2" ]; then + bash bash/utils.sh log_silent "$1" /var/log/workspace-init.log + else + bash bash/utils.sh log_silent "$1" /var/log/workspace-init.log -e + fi +} \ No newline at end of file