logging: add LOG_DEBUG level; qat: map log level to QATzip log level#56
Open
asonje wants to merge 12 commits intointel:mainfrom
Open
logging: add LOG_DEBUG level; qat: map log level to QATzip log level#56asonje wants to merge 12 commits intointel:mainfrom
asonje wants to merge 12 commits intointel:mainfrom
Conversation
Signed-off-by: Olasoji <[email protected]>
Signed-off-by: Olasoji <[email protected]>
Signed-off-by: Olasoji <[email protected]>
Signed-off-by: Olasoji <[email protected]>
Signed-off-by: Olasoji <[email protected]>
returned eos isnt erronously set. Signed-off-by: Olasoji <[email protected]>
Signed-off-by: Olasoji <[email protected]>
Introduce LOG_DEBUG (value=1) as the most verbose log level, shifting LOG_INFO to 2 and LOG_ERROR to 3. This follows the conventional ordering used by syslog, Log4j, Python logging, and QATzip itself (where higher values mean more verbose). The default log level remains LOG_ERROR (now value=3), so existing deployments see no behavioral change unless they explicitly set a lower value in /etc/zlib-accel.conf. The config parser max for log_level is updated from 2 to 3 accordingly. In qat.cpp, replace the hardcoded qzSetLogLevel(LOG_NONE) with a dynamic mapping from the configured log_level: LOG_DEBUG -> LOG_DEBUG3 (maximum QATzip verbosity) LOG_INFO -> LOG_INFO LOG_ERROR -> LOG_ERROR default -> LOG_NONE This corrects an inversion present in PR intel#55 of intel/zlib-accel, where LOG_ERROR was incorrectly mapped to LOG_DEBUG3. New tests: LogDebugLevel, LogDebugFilteredByInfo; LogLevelFiltering extended to cover DEBUG filtering. Builds on: intel#55 Signed-off-by: Olasoji <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR extends the shim’s logging configuration by introducing a new LOG_DEBUG level, updates defaults/documentation to match the new numeric mapping, and propagates the configured verbosity into QATzip via qzSetLogLevel().
Changes:
- Add
LOG_DEBUGtoLogLeveland support"Debug:"-prefixed log output with updated filtering behavior. - Update default
log_levelfrom2to3across config sources and tests to preserve “error-only” default behavior under the new scheme. - Map shim
log_levelto QATzip’sQzLogLevel_Tduring QAT session initialization.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/zlib_accel_test.cpp | Updates expected default log_level value to match new defaults. |
| tests/logging_test.cpp | Adds/updates tests for DEBUG logging and revised filtering semantics. |
| qat.cpp | Maps shim log_level to QATzip log level and applies it via qzSetLogLevel(). |
| logging.h | Adds LOG_DEBUG and emits "Debug:" prefix; relies on numeric threshold filtering. |
| config/default_config | Bumps default log_level to 3 (error-only under new mapping). |
| config/config.cpp | Updates in-code default and max allowed log_level to 3. |
| README.md | Updates log_level value range/default and explains new meanings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Without the DEBUG_LOG guard, a release build (DEBUG_LOG=OFF) with a non-zero log_level in the config would cause QATzip to emit verbose output, contradicting the documented behaviour that log_level only applies when built with DEBUG_LOG=ON. Gate the dynamic mapping behind #ifdef DEBUG_LOG and unconditionally set LOG_NONE in the else branch, matching the original behaviour for non-debug builds. Addresses Copilot review comment on PR intel#56. Signed-off-by: Olasoji <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
builds on PR #55
adds new log level LOG_DEBUG and updates the README