my
$ENV_PREFIX
=
'T_LCWL'
;
my
$GRP_PREFIX
=
'T_LCWL_GROUP'
;
-levels
=> [
qw( trace debug info warn fatal custom )
];
my
$t_env
= with_env();
my
$elip
=
chr
(166);
Log::Contextual::WarnLogger::Fancy::_gen_level(
'custom'
);
sub
every_log {
my
(
$logger
) =
@_
;
push
@{
$logger
->{levels} },
'custom'
;
$logger
->{level_nums}->{custom} = 20;
$logger
->{level_labels}->{custom} =
'custo'
;
log_trace {
'trace message'
};
log_debug {
'debug message'
};
log_info {
'info message'
};
log_warn {
'warn message'
};
log_fatal {
'fatal message'
};
log_custom {
'custom message'
};
}
eq_or_diff(
colorstrip(
with_env()->with_warner(
env_prefix
=>
$ENV_PREFIX
)
->run( \
&every_log
),
),
"[warn ] warn message\n[fatal] fatal message\n[custo] custom message\n"
,
"Default has warning and fatals shown but not info"
);
done_testing;