Skip to content

Commit

Permalink
🐛 FIX: #82
Browse files Browse the repository at this point in the history
  • Loading branch information
apolopena committed Mar 30, 2021
1 parent 4f6ee13 commit 0a30cd0
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions bash/workspace-init-log.sh
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 0a30cd0

Please sign in to comment.