Add a verbose logging tier and move the highest-volume traces onto it - #11387
Open
dgarske wants to merge 1 commit into
Open
Add a verbose logging tier and move the highest-volume traces onto it#11387dgarske wants to merge 1 commit into
dgarske wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
One updated DEBUG_CRYPTOCB-gated trace in wolfcrypt/test/test.c uses WOLFSSL_MSG_EX, which is compiled out without DEBUG_WOLFSSL, so DEBUG_CRYPTOCB alone will not actually enable that trace as intended.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Introduces a new “verbose” logging tier to reduce DEBUG_WOLFSSL log volume by moving the highest-frequency traces behind WOLFSSL_VERBOSE_LOGGING (with WOLFSSL_DEBUG_OPENSSL treated as an alias), improving CI log usability while keeping deep tracing available when explicitly enabled.
Changes:
- Add
WOLFSSL_MSG_VERBOSE()/WOLFSSL_ENTER_VERBOSE()/WOLFSSL_LEAVE_VERBOSE()macros gated onWOLFSSL_VERBOSE_LOGGING(orWOLFSSL_DEBUG_OPENSSL). - Move high-volume traces in ASN/X509/OpenSSL-compat helpers from normal debug logging to the new verbose tier.
- Adjust crypto callback test logging to avoid emitting per-callback lines under
DEBUG_WOLFSSL.
File summaries
| File | Description |
|---|---|
| wolfssl/wolfcrypt/logging.h | Defines the new verbose logging macros and documents intended usage and aliasing. |
| wolfcrypt/test/test.c | Changes crypto callback trace gating to reduce extremely high-volume DEBUG_WOLFSSL output. |
| wolfcrypt/src/asn.c | Moves frequent ASN-related traces to the verbose logging tier. |
| src/x509.c | Moves high-frequency OpenSSL-compat X509/X509_NAME tracing to the verbose logging tier and removes hand-rolled guards. |
| src/ssl.c | Updates build-option comment to describe WOLFSSL_DEBUG_OPENSSL as an alias for verbose logging. |
| src/ssl_sk.c | Moves stack/container helper traces to the verbose logging tier. |
| src/ssl_bn.c | Replaces per-function #ifdef WOLFSSL_DEBUG_OPENSSL entry traces with WOLFSSL_ENTER_VERBOSE. |
| src/ssl_asn1.c | Moves OpenSSL-compat ASN1 helper traces to verbose logging macros. |
| src/internal.c | Relocates a high-frequency RetrySendAlert entry trace to only log when an alert is actually pending. |
| src/bio.c | Moves some OpenSSL-compat BIO helper traces to WOLFSSL_ENTER_VERBOSE. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+81415
to
81421
| /* One line per crypto-callback invocation - millions across the test | ||
| * suite. DEBUG_CRYPTOCB is the existing switch for crypto-callback | ||
| * tracing (see wolfcrypt/src/cryptocb.c), so use it rather than riding on | ||
| * DEBUG_WOLFSSL. wolfssl_log() appends its own newline. */ | ||
| #ifdef DEBUG_CRYPTOCB | ||
| WOLFSSL_MSG_EX("CryptoDevCb: Algo Type %d", info->algo_type); | ||
| #endif |
Comment on lines
+444
to
+449
| /* Verbose message logging. | ||
| * | ||
| * The sibling of WOLFSSL_VERBOSE_ERRORS / WOLFSSL_ERROR_VERBOSE above: that | ||
| * pair controls how much detail reaches the *error queue*, this one controls | ||
| * how much reaches the *log*. Off even when DEBUG_WOLFSSL is on. | ||
| * |
dgarske
force-pushed
the
log_verbose_tier
branch
from
September 6, 2026 14:28
36af419 to
0163fd1
Compare
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.
Description
tests/unit.test emits 722 MB across 29.0 million lines under DEBUG_WOLFSSL, which makes the output impractical to read and truncates CI job logs before anything useful can be recovered.
WOLFSSL_DEBUG_OPENSSL was already this idea, but only as 23 hand-rolled #ifdef/ENTER/#endif blocks. This promotes it into a real tier: WOLFSSL_MSG_VERBOSE() / WOLFSSL_ENTER_VERBOSE() / WOLFSSL_LEAVE_VERBOSE(), gated on WOLFSSL_VERBOSE_LOGGING — the sibling of the existing WOLFSSL_VERBOSE_ERRORS / WOLFSSL_ERROR_VERBOSE pair (that controls the error queue, this controls the log). WOLFSSL_DEBUG_OPENSSL is honored as an alias, so existing users see no change.
Testing
Result: 722 MB → 271 MB (62% smaller), in a diff that is net −10 lines, because promoting the idiom removes the boilerplate.
Checklist