log
This commit is contained in:
parent
5433ef186a
commit
2520fbee34
1 changed files with 20 additions and 0 deletions
20
bash/log.sh
Normal file
20
bash/log.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
LOG_LEVEL_FATAL=0
|
||||
LOG_LEVEL_ERROR=1
|
||||
LOG_LEVEL_WARN=2
|
||||
LOG_LEVEL_INFO=3
|
||||
LOG_LEVEL_DEBUG=4
|
||||
LOG_LEVEL_TRACE=5
|
||||
|
||||
LOG_LEVEL=${LOG_LEVEL_WARNING}
|
||||
|
||||
function log_fatal { [ ${LOG_LEVEL} -ge ${LOG_LEVEL_FATAL} ] && echo "${@}" ; }
|
||||
|
||||
function log_error { [ ${LOG_LEVEL} -ge ${LOG_LEVEL_ERROR} ] && echo "${@}" ; }
|
||||
|
||||
function log_warn { [ ${LOG_LEVEL} -ge ${LOG_LEVEL_WARN} ] && echo "${@}" ; }
|
||||
|
||||
function log_info { [ ${LOG_LEVEL} -ge ${LOG_LEVEL_INFO} ] && echo "${@}" ; }
|
||||
|
||||
function log_debug { [ ${LOG_LEVEL} -ge ${LOG_LEVEL_DEBUG} ] && echo "${@}" ; }
|
||||
|
||||
function log_trace { [ ${LOG_LEVEL} -ge ${LOG_LEVEL_TRACE} ] && echo "${@}" ; }
|
Loading…
Reference in a new issue