Log
Index¶
log::log¶
Print a green timestamped info message to stderr, prefixed with the script name.
Arguments¶
- ... (message): text
log::with_date¶
Print a green timestamped info message (with full date) to stderr, prefixed with the script name.
Arguments¶
- ... (message): text
log::warn¶
Print a yellow timestamped warning message to stderr, prefixed with the script name.
Arguments¶
- ... (message): text
log::die¶
Print a red error message with caller context to stderr and exit with status 1.
Arguments¶
- ... (message): text
log::_err_trap_handler¶
Print a red timestamped ERROR line to stderr; intended for use as an ERR trap handler.
Arguments¶
- $1 (exit): code of the failing command
- $2 (line): number where the error occurred
- $3 (the): failing command string (BASH_COMMAND)
log::enable_err_trap¶
Install an ERR trap that prints a red error line via log::_err_trap_handler on any unhandled failure.
Function has no arguments.