Created
October 21, 2015 16:24
-
-
Save rothwerx/7aa31f5437a4fc2b9416 to your computer and use it in GitHub Desktop.
Bash: Logging helper function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pecho { | |
if [[ $LOGGING ]]; then | |
printf "$@" | tee -a some.log | |
else | |
printf "$@" | |
fi | |
} | |
pecho "%-10s %10s\n" "Logging:" "On" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment