log: Add BASH_IT_LOG_PREFIX option

Also add a new test to check it
This commit is contained in:
Noah Gorny
2020-06-25 00:09:19 +03:00
parent afbb7e18e1
commit 9a23725ce0
3 changed files with 17 additions and 2 deletions

View File

@@ -77,3 +77,10 @@ load ../../lib/log
run _log_error "test test test"
refute_output
}
@test "lib log: logging with prefix" {
BASH_IT_LOG_LEVEL=$BASH_IT_LOG_LEVEL_ALL
BASH_IT_LOG_PREFIX="nice: prefix: "
run _log_debug "test test test"
assert_output "nice: prefix: DEBUG: test test test"
}