logs: preserve relative path of source files#500
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccb1fd7f30
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| continue; | ||
| } | ||
| base = p + 1; | ||
| if (p[1] == 's' && p[2] == 'r' && p[3] == 'c' && p[4] == separator) { |
There was a problem hiding this comment.
Preserve paths that already begin with src/
In builds where __FILE__ is already repo-relative (for example after -fmacro-prefix-map or when the compiler is passed src/foo.cpp), the leading src/ has no preceding separator, so this check never recognizes it and the fallback returns only the basename (foo.cpp). That drops the relative path this helper is meant to preserve and prevents log callbacks from linking back to the source file in those builds; please also handle src/ at the start of path.
Useful? React with 👍 / 👎.
|
🎯 Code Coverage (details) 🔗 Commit SHA: 1f73694 | Docs | Datadog PR Page | Give us feedback! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #500 +/- ##
=======================================
Coverage 84.78% 84.78%
=======================================
Files 191 191
Lines 9341 9341
Branches 4184 4184
=======================================
Hits 7920 7920
Misses 529 529
Partials 892 892
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Dynamic Artifact Size Comparison 📦
Static Artifact Size Comparison 📦
|
7ea1f1d to
dda805b
Compare
|
I'm ok with the PR but what's the motivation behind? |
it's so that the file where the log call is made can be identified unambiguously. Discard the relative path to src removes needed information to e.g. automatically link to the relevant line. |
dda805b to
1f73694
Compare
So we can properly link to them.