Package: logger_pkg
- File: logger_pkg.vhd
Constants
Name | Type | Value | Description |
---|---|---|---|
null_logger | logger_t | (p_data => null_ptr) | |
no_time_check | time | -1 ns | Constant to ignore time value when checking log call |
Types
Name | Type | Description |
---|---|---|
logger_t | ||
logger_vec_t | array (natural range <>) of logger_t |
Functions
- trace (logger : logger_t;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
Description
Log procedures for each log level
- debug (logger : logger_t;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- pass (logger : logger_t;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- info (logger : logger_t;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- warning (logger : logger_t;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- error (logger : logger_t;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- failure (logger : logger_t;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- warning_if (logger : logger_t;
condition : boolean;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- error_if (logger : logger_t;
condition : boolean;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- failure_if (logger : logger_t;
condition : boolean;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- trace (msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- debug (msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- pass (msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- info (msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- warning (msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- error (msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- failure (msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- warning_if (condition : boolean;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- error_if (condition : boolean;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- failure_if (condition : boolean;
msg : string;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- log (logger : logger_t;
msg : string;
log_level : log_level_t := info;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
Description
Log procedure with level as argument
- log (msg : string;
log_level : log_level_t := info;
path_offset : natural := 0;
line_num : natural := 0;
file_name : string := "") return ()
- set_stop_count (logger : logger_t;
log_level : log_level_t;
value : positive;
unset_children : boolean := false) return ()
Description
Set the threshold for stopping simulation for a specific log level and
logger tree
- disable_stop (logger : logger_t;
log_level : log_level_t;
unset_children : boolean := false) return ()
Description
Disable stopping simulation for a specific log level and
logger tree
- set_stop_count (log_level : log_level_t;
value : positive) return ()
Description
Set the threshold for stopping simulation for a specific log level in
the entire logging tree.
NOTE: Removes all other stop count settings for log_level in entire tree.
- disable_stop (log_level : log_level_t) return ()
Description
Disable stopping simulation for a specific log level in
the entire logging tree.
NOTE: Removes all other stop count settings for log_level in entire tree.
- set_stop_level (logger : logger_t;
log_level : alert_log_level_t) return ()
Description
Shorthand for configuring the stop counts for (warning, error, failure) in
a logger subtree. Set stop count to infinite for all levels < log_level and
1 for all (warning, error, failure) >= log_level.
NOTE: Removes all other stop count settings from logger subtree.
- set_stop_level (level : alert_log_level_t) return ()
Description
Shorthand for configuring the stop counts in entire logger tree.
Same behavior as set_stop_level for specific logger subtree above
- unset_stop_count (logger : logger_t;
log_level : log_level_t;
unset_children : boolean := false) return ()
Description
Unset stop count for stopping simulation for a specific log level and
logger tree
- disable (logger : logger_t;
log_level : log_level_t;
include_children : boolean := true) return ()
Description
Disable a log_level from specific logger including all children.
Disable is used when a log message is unwanted and it should be ignored.
NOTE: A disabled log message is still counted to get a disabled log count
statistics.
errors and failures can be disabled but the final_log_check must
explicitly allow it as well as an extra safety mechanism.
- hide (log_handler : log_handler_t;
log_level : log_level_t) return ()
Description
Hide log messages of specified level to this handler.
- hide (logger : logger_t;
log_handler : log_handler_t;
log_level : log_level_t;
include_children : boolean := true) return ()
Description
Hide log messages from the logger of the specified level to this handler
- hide (log_handler : log_handler_t;
log_levels : log_level_vec_t) return ()
Description
Hide log messages of the specified levels to this handler.
- hide (logger : logger_t;
log_handler : log_handler_t;
log_levels : log_level_vec_t;
include_children : boolean := true) return ()
Description
Hide log messages from the logger of the specified levels to this handler
- show (log_handler : log_handler_t;
log_level : log_level_t) return ()
Description
Show log messages of the specified log_level to this handler
- show (logger : logger_t;
log_handler : log_handler_t;
log_level : log_level_t;
include_children : boolean := true) return ()
Description
Show log messages from the logger of the specified log_level to this handler
- show (log_handler : log_handler_t;
log_levels : log_level_vec_t) return ()
Description
Show log messages of the specified log_levels to this handler
- show (logger : logger_t;
log_handler : log_handler_t;
log_levels : log_level_vec_t;
include_children : boolean := true) return ()
Description
Show log messages from the logger of the specified log_levels to this handler
- show_all (log_handler : log_handler_t) return ()
Description
Show all log levels to the log handler
- show_all (logger : logger_t;
log_handler : log_handler_t;
include_children : boolean := true) return ()
Description
Show all log levels to the handler from specific logger
- hide_all (log_handler : log_handler_t) return ()
Description
Hide all log levels from this handler
- hide_all (logger : logger_t;
log_handler : log_handler_t;
include_children : boolean := true) return ()
Description
Hide all log levels from this handler from specific logger
- set_log_handlers (logger : logger_t;
log_handlers : log_handler_vec_t;
include_children : boolean := true) return ()
Description
Set the log handlers for this logger
- reset_log_count (logger : logger_t;
log_level : log_level_t := null_log_level;
include_children : boolean := true) return ()
Description
Reset the log call count of a specific level or all levels when level = null_log_level
- final_log_check (allow_disabled_errors : boolean := false;
allow_disabled_failures : boolean := false;
fail_on_warning : boolean := false) return ()
Description
Perform a check of the log counts and fail unless there are no errors or failures.
By default no disabled errors or failures are not allowed.
Disabled errors and failrues can be allowed by setting the corresponding
arguments to true.
By default warnings are allowed but failure on warning can be enabled.
When fail on warning is enabled it also allows disabled warnings.
- mock (logger : logger_t) return ()
Description
Mock procedures to enable unit testing of code performing logging
Mock the logger preventing simulaton abort and recording all logs to it
- mock (logger : logger_t;
log_level : log_level_t) return ()
Description
Mock log_level of logger preventing simulaton abort and recording all logs to it
- unmock (logger : logger_t) return ()
Description
Unmock the logger returning it to its normal state
Results in failures if there are still unchecked log calls recorded
- check_log (logger : logger_t;
msg : string;
log_level : log_level_t;
log_time : time := no_time_check;
line_num : natural := 0;
file_name : string := "") return ()
Description
Check that the earliest recorded log call in the mock state matches this
call or fails. Also consumes this recorded log call such that subsequent
check_log calls can be used to verify a sequence of log calls
- check_only_log (logger : logger_t;
msg : string;
log_level : log_level_t;
log_time : time := no_time_check;
line_num : natural := 0;
file_name : string := "") return ()
Description
Check that there is only one recorded log call remaining
- check_no_log () return ()
Description
Check that there are no remaining recorded log calls, automatically called
during unmock