Commit c0e0859d authored by Martin Jeřábek's avatar Martin Jeřábek

test: add debug_l loglevel, disable trace & pass levels

parent d5c8bdc2
...@@ -104,6 +104,7 @@ package CANtestLib is ...@@ -104,6 +104,7 @@ package CANtestLib is
-- Logger severity type (severities in increasing order) -- Logger severity type (severities in increasing order)
type log_lvl_type is ( type log_lvl_type is (
debug_l,
info_l, info_l,
warning_l, warning_l,
error_l error_l
...@@ -585,7 +586,8 @@ package CANtestLib is ...@@ -585,7 +586,8 @@ package CANtestLib is
-- VUnit from configuration. -- VUnit from configuration.
-- --
-- Log levels are bound to Vunit Logging library: -- Log levels are bound to Vunit Logging library:
-- info_l - All logs are shown -- debug_l - All logs are shown (even pass and trace)
-- info_l - info(), warning(), error(), failure() are shown
-- warning_l - warning(), error(), failure() are shown -- warning_l - warning(), error(), failure() are shown
-- error_l - error(), failure() are shown -- error_l - error(), failure() are shown
-- --
...@@ -2043,24 +2045,25 @@ package body CANtestLib is ...@@ -2043,24 +2045,25 @@ package body CANtestLib is
constant log_level : in log_lvl_type constant log_level : in log_lvl_type
) is ) is
begin begin
case log_level is show_all(display_handler);
when error_l => if log_level >= debug_l then
show_all(display_handler); null;
hide(display_handler, debug); end if;
hide(display_handler, info);
hide(display_handler, pass); if log_level >= info_l then
hide(display_handler, warning); hide(display_handler, pass);
when warning_l => hide(display_handler, trace);
show_all(display_handler); null;
hide(display_handler, debug); end if;
hide(display_handler, pass);
hide(display_handler, info); if log_level >= warning_l then
when info_l => hide(display_handler, debug);
show_all(display_handler); hide(display_handler, info);
--hide(logger, display_handler, debug); end if;
when others =>
failure("Unknwon log level."); if log_level >= error_l then
end case; hide(display_handler, warning);
end if;
end procedure; end procedure;
...@@ -2086,13 +2089,7 @@ package body CANtestLib is ...@@ -2086,13 +2089,7 @@ package body CANtestLib is
info("Test info:"); info("Test info:");
info("Number of iterations: " & integer'image(iterations)); info("Number of iterations: " & integer'image(iterations));
if (log_level = info_l) then info("Log level: " & log_lvl_type'image(log_level));
info("Log level: INFO,WARNING,ERROR logs are shown!");
elsif (log_level = warning_l) then
info("Log level: WARNING,ERROR logs are shown!");
else
info("Log level: ERROR logs are shown!");
end if;
set_log_level(log_level); set_log_level(log_level);
if (error_beh = go_on) then if (error_beh = go_on) then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment