lib/log: default to no logging at all
Set the default when BASH_IT_LOG_LEVEL is unbound to log level none: no warnings or errors are reported at all.
This commit is contained in:
@@ -33,7 +33,7 @@ function _log_debug()
|
|||||||
example '$ _log_debug "Loading plugin git..."'
|
example '$ _log_debug "Loading plugin git..."'
|
||||||
group 'log'
|
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"
|
_log_general "${echo_green:-}" "DEBUG: " "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ function _log_warning()
|
|||||||
example '$ _log_warning "git binary not found, disabling git plugin..."'
|
example '$ _log_warning "git binary not found, disabling git plugin..."'
|
||||||
group 'log'
|
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"
|
_log_general "${echo_yellow:-}" " WARN: " "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,6 +55,6 @@ function _log_error()
|
|||||||
example '$ _log_error "Failed to load git plugin..."'
|
example '$ _log_error "Failed to load git plugin..."'
|
||||||
group 'log'
|
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"
|
_log_general "${echo_red:-}" "ERROR: " "$1"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user