Skip to content

logging: add LOG_DEBUG level; qat: map log level to QATzip log level#56

Open
asonje wants to merge 12 commits intointel:mainfrom
asonje:pr-55-qat-log-level
Open

logging: add LOG_DEBUG level; qat: map log level to QATzip log level#56
asonje wants to merge 12 commits intointel:mainfrom
asonje:pr-55-qat-log-level

Conversation

@asonje
Copy link
Copy Markdown
Contributor

@asonje asonje commented Apr 30, 2026

builds on PR #55
adds new log level LOG_DEBUG and updates the README

asonje added 10 commits October 23, 2025 14:46
Signed-off-by: Olasoji <[email protected]>
returned eos isnt erronously set.

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]>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_DEBUG to LogLevel and support "Debug:"-prefixed log output with updated filtering behavior.
  • Update default log_level from 2 to 3 across config sources and tests to preserve “error-only” default behavior under the new scheme.
  • Map shim log_level to QATzip’s QzLogLevel_T during 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.

Comment thread qat.cpp Outdated
Comment thread README.md
asonje and others added 2 commits April 30, 2026 15:14
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants