Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Fred Palmer
log_info "I have you now!";
log_success "You're all clear kid, now let's blow this thing and go home.";
log_error "One thing's for sure, we're all gonna be a lot thinner.";
log_debug "It's time to dig it...Lets go...";

# If you have figlet installed -- you'll see some big letters on the screen!
log_captains "What was in the captain's toilet?";
Expand Down Expand Up @@ -54,6 +55,10 @@ Fred Palmer
* **log_error**

Prints an "ERROR" level message to stdout with the timestamp of the occurrence.

* **log_debug**

Prints an "DEBUG" level message to stdout with the timestamp of the occurrence.

### Special Logging Abilities

Expand Down
13 changes: 7 additions & 6 deletions log4bash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ SCRIPT_BASE_DIR="$(cd "$( dirname "$0")" && pwd )"

# This should probably be the right way - didn't have time to experiment though
# declare -r INTERACTIVE_MODE="$([ tty --silent ] && echo on || echo off)"
declare -r INTERACTIVE_MODE=$([ "$(uname)" == "Darwin" ] && echo "on" || echo "off")
# declare -r INTERACTIVE_MODE=$([ "$(uname)" == "Darwin" ] && echo "on" || echo "off")
INTERACTIVE_MODE=on

#--------------------------------------------------------------------------------------------------
# Begin Help Section

HELP_TEXT=""
# HELP_TEXT=""

# This function is called in the event of an error.
# Scripts which source this script may override by defining their own "usage" function
usage() {
echo -e "${HELP_TEXT}";
exit 1;
}
# usage() {
# echo -e "${HELP_TEXT}";
# exit 1;
# }

# End Help Section
#--------------------------------------------------------------------------------------------------
Expand Down