You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the debug level in filter_variants.sh is not clearly defined. There are inconsistencies in how and when messages are shown, particularly with ERROR messages not being logged to the console as expected. The debug levels need to be clearly defined to ensure that appropriate messages are displayed based on the selected level.
Steps to Reproduce
Set the debug level to any available option (INFO, WARN, ERROR, DEBUG).
Run the script with conditions that should trigger various log levels (e.g., errors, warnings, info messages).
Observe that ERROR messages are not logged to the console.
Expected Behavior
INFO: Should display general informational messages about the script’s progress and key milestones.
WARN: Should display warnings about potential issues that do not stop the script from executing.
ERROR: Should display error messages that indicate problems, whether or not they halt the execution.
DEBUG: Should display detailed debugging information, including all INFO, WARN, and ERROR messages, as well as additional data useful for troubleshooting.
Actual Behavior
ERROR messages are not consistently logged to the console.
There is a lack of clarity on which messages are displayed for each debug level.
Proposed Changes
Clearly define the expected behavior for each debug level.
Ensure that all ERROR messages are logged to the console regardless of the debug level.
Implement a consistent logging mechanism that adheres to the defined behavior for each level.
Update the script to log messages appropriately based on the configured debug level.
Impact
Improving the debug level implementation will enhance the script’s usability and maintainability, making it easier to diagnose and resolve issues.
Additional Notes
Ensure backward compatibility with existing usage.
Update the documentation to reflect the new behavior and usage instructions for the debug levels.
Relevant Code Snippet
# Example of the current debug level implementationlog_message() {
local message="$1"local level="$2"case$levelin"INFO")
[ "$DEBUG_LEVEL"=="INFO" ] &&echo"[INFO] $message"
;;
"WARN")
[ "$DEBUG_LEVEL"=="INFO" ] || [ "$DEBUG_LEVEL"=="WARN" ] &&echo"[WARN] $message"
;;
"ERROR")
[ "$DEBUG_LEVEL"=="INFO" ] || [ "$DEBUG_LEVEL"=="WARN" ] || [ "$DEBUG_LEVEL"=="ERROR" ] &&echo"[ERROR] $message"
;;
"DEBUG")
[ "$DEBUG_LEVEL"=="DEBUG" ] &&echo"[DEBUG] $message"
;;
esac
}
# Example issue: ERROR messages are not shown when DEBUG_LEVEL is set to ERROR
The text was updated successfully, but these errors were encountered:
Description
The current implementation of the debug level in
filter_variants.sh
is not clearly defined. There are inconsistencies in how and when messages are shown, particularly with ERROR messages not being logged to the console as expected. The debug levels need to be clearly defined to ensure that appropriate messages are displayed based on the selected level.Steps to Reproduce
Expected Behavior
Actual Behavior
Proposed Changes
Impact
Improving the debug level implementation will enhance the script’s usability and maintainability, making it easier to diagnose and resolve issues.
Additional Notes
Relevant Code Snippet
The text was updated successfully, but these errors were encountered: