bash-tui-toolkit

Logging

Provide logging helpers for structured logging

Overview

Parse log level from text representation to level number

Index

parse_log_level

Parse log level from text representation to level number

Example

# Parse lower case log level
parse_log_level "info"
# Parse upper case log level
parse_log_level "ERROR"

Arguments

Variables set

Output on stdout

log

Log output on a given level, checks if $LOG_LEVEL, if not set defaults to INFO

Example

# Log a message on info level
log "$LOG_INFO" "this is a info message"
log "LOG_DEBUG" "i am only visible when \$LOG_LEVEL is debug"

Arguments

Output on stdout