Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bash: Logging helper function
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