Skip to content

Add a verbose logging tier and move the highest-volume traces onto it - #11387

Open
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:log_verbose_tier
Open

Add a verbose logging tier and move the highest-volume traces onto it#11387
dgarske wants to merge 1 commit into
wolfSSL:masterfrom
dgarske:log_verbose_tier

Conversation

@dgarske

@dgarske dgarske commented Sep 6, 2026

Copy link
Copy Markdown
Member

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

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@dgarske dgarske self-assigned this Sep 6, 2026
Copilot AI lite review requested due to automatic review settings September 6, 2026 03:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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 on WOLFSSL_VERBOSE_LOGGING (or WOLFSSL_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 thread wolfcrypt/test/test.c
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.
*
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