Skip to content

Commit

Permalink
πŸ”€ MERGE: #82, change name to workspace-init-logger.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
apolopena committed Mar 30, 2021
2 parents 0bc6721 + 2041896 commit cd15c0a
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions bash/workspace-init-log.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#
# SPDX-License-Identifier: MIT
# Copyright Β© 2021 Apolo Pena
#
# 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 cd15c0a

Please sign in to comment.