Skip to content

Instantly share code, notes, and snippets.

@fredpalmer
Created May 26, 2011 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fredpalmer/992407 to your computer and use it in GitHub Desktop.
Save fredpalmer/992407 to your computer and use it in GitHub Desktop.
log4bash example
#!/usr/bin/env bash
#--------------------------------------------------------------------------------------------------
# log4bash - Makes logging in Bash scripting suck less
# Copyright (c) Fred Palmer
# Licensed under the MIT license
# http://github.com/fredpalmer/log4bash
#--------------------------------------------------------------------------------------------------
source ../log4bash.sh
log "This is regular log message... ";
log_info "So is this...";
log_success "Yeah!! Awesome Possum.";
log_warning "Luke ... you turned off your targeting computer";
log_error "Whoops! I made a booboo";
# If you have figlet installed -- you'll see some big letters on the screen!
log_captains "What was in the captain's toilet?";
# If you have the "say" command (e.g. on a Mac)
log_speak "Resistance is futile";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment