Rust: Add sinks for tracing - #22341
Open
geoffw0 wants to merge 7 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Rust cleartext-logging and log-injection sink support for the tracing crate.
Changes:
- Models
tracinglogging, event, and span macros as sinks. - Adds test cases and dependency updates.
- Documents framework support and adds a change note.
Show a summary per file
| File | Description |
|---|---|
LogInjectionExtensions.qll |
Defines tracing macro sinks. |
CleartextLoggingExtensions.qll |
Reuses tracing sinks for cleartext logging. |
test_logging.rs |
Adds tracing test cases. |
options.yml |
Adds the tracing dependency. |
Cargo.lock |
Locks updated dependencies. |
CleartextLogging.expected |
Updates generated test results. |
2026-08-13-cleartext-logging.md |
Records the analysis change. |
supported-frameworks.rst |
Lists tracing support. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 6/8 changed files
- Comments generated: 2
- Review effort level: Balanced
| m.getName().getText() = ["trace", "debug", "info", "warn", "error", "event", "span"] and | ||
| m.getLocation().getFile() = c.getASourceFile().getFile() and | ||
| mc.resolveMacro() = m and | ||
| this.asExpr().getParentNode*() = mc.getMacroCallExpansion() |
Contributor
Author
There was a problem hiding this comment.
Yes, it would be better to avoid sink and result duplication here. I'm going to have to think about the best way to do this. If nothing else, we can make sink nodes isBarrierOut nodes to avoid duplicating results (though we will still have duplicate sinks with that strategy).
Performance seemed OK locally, but DCA will confirm.
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.
Add sinks for the tracing crate. This is a popular logging library, an AI I was working with (Fable) suggested I add support for it - though I've cleaned up the solution it offered quite a bit. Sadly models-as-data sinks don't seem to be feasible in this case.