2023-06-04 10:43:40 +02:00
|
|
|
use std *
|
|
|
|
|
2023-06-10 20:16:17 +02:00
|
|
|
def test_env_log_ansi [] {
|
2023-06-04 10:43:40 +02:00
|
|
|
assert equal $env.LOG_ANSI.CRITICAL (ansi red_bold)
|
|
|
|
assert equal $env.LOG_ANSI.ERROR (ansi red)
|
|
|
|
assert equal $env.LOG_ANSI.WARNING (ansi yellow)
|
|
|
|
assert equal $env.LOG_ANSI.INFO (ansi default)
|
|
|
|
assert equal $env.LOG_ANSI.DEBUG (ansi default_dimmed)
|
|
|
|
}
|
|
|
|
|
2023-06-10 20:16:17 +02:00
|
|
|
def test_env_log_level [] {
|
2023-06-04 10:43:40 +02:00
|
|
|
assert equal $env.LOG_LEVEL.CRITICAL 50
|
|
|
|
assert equal $env.LOG_LEVEL.ERROR 40
|
|
|
|
assert equal $env.LOG_LEVEL.WARNING 30
|
|
|
|
assert equal $env.LOG_LEVEL.INFO 20
|
|
|
|
assert equal $env.LOG_LEVEL.DEBUG 10
|
|
|
|
}
|
|
|
|
|
2023-06-10 20:16:17 +02:00
|
|
|
def test_env_log_prefix [] {
|
2023-06-04 10:43:40 +02:00
|
|
|
assert equal $env.LOG_PREFIX.CRITICAL "CRT"
|
|
|
|
assert equal $env.LOG_PREFIX.ERROR "ERR"
|
|
|
|
assert equal $env.LOG_PREFIX.WARNING "WRN"
|
|
|
|
assert equal $env.LOG_PREFIX.INFO "INF"
|
|
|
|
assert equal $env.LOG_PREFIX.DEBUG "DBG"
|
|
|
|
}
|
|
|
|
|
2023-06-10 20:16:17 +02:00
|
|
|
def test_env_log_short_prefix [] {
|
2023-06-04 10:43:40 +02:00
|
|
|
assert equal $env.LOG_SHORT_PREFIX.CRITICAL "C"
|
|
|
|
assert equal $env.LOG_SHORT_PREFIX.ERROR "E"
|
|
|
|
assert equal $env.LOG_SHORT_PREFIX.WARNING "W"
|
|
|
|
assert equal $env.LOG_SHORT_PREFIX.INFO "I"
|
|
|
|
assert equal $env.LOG_SHORT_PREFIX.DEBUG "D"
|
|
|
|
}
|
|
|
|
|
2023-06-10 20:16:17 +02:00
|
|
|
def test_env_log_format [] {
|
2023-06-04 10:43:40 +02:00
|
|
|
assert equal $env.LOG_FORMAT $"%ANSI_START%%DATE%|%LEVEL%|(ansi u)%MSG%%ANSI_STOP%"
|
2023-06-10 20:16:17 +02:00
|
|
|
}
|