Skip to content

Commit

Permalink
lib/log: default to no logging at all
Browse files Browse the repository at this point in the history
Set the default when BASH_IT_LOG_LEVEL is unbound to log level none: no warnings or errors are reported at all.
  • Loading branch information
gaelicWizard committed Aug 26, 2021
1 parent 3654198 commit 8540874
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/log.bash
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function _log_debug()
example '$ _log_debug "Loading plugin git..."'
group 'log'

[[ "${BASH_IT_LOG_LEVEL:-1}" -ge $BASH_IT_LOG_LEVEL_ALL ]] || return 0
[[ "${BASH_IT_LOG_LEVEL:-0}" -ge $BASH_IT_LOG_LEVEL_ALL ]] || return 0
_log_general "${echo_green:-}" "DEBUG: " "$1"
}

Expand All @@ -44,7 +44,7 @@ function _log_warning()
example '$ _log_warning "git binary not found, disabling git plugin..."'
group 'log'

[[ "${BASH_IT_LOG_LEVEL:-1}" -ge $BASH_IT_LOG_LEVEL_WARNING ]] || return 0
[[ "${BASH_IT_LOG_LEVEL:-0}" -ge $BASH_IT_LOG_LEVEL_WARNING ]] || return 0
_log_general "${echo_yellow:-}" " WARN: " "$1"
}

Expand All @@ -55,6 +55,6 @@ function _log_error()
example '$ _log_error "Failed to load git plugin..."'
group 'log'

[[ "${BASH_IT_LOG_LEVEL:-1}" -ge $BASH_IT_LOG_LEVEL_ERROR ]] || return 0
[[ "${BASH_IT_LOG_LEVEL:-0}" -ge $BASH_IT_LOG_LEVEL_ERROR ]] || return 0
_log_general "${echo_red:-}" "ERROR: " "$1"
}

0 comments on commit 8540874

Please sign in to comment.