refactor: migrate to use build_info and log_utils crates for build information and logging framework#161
Merged
ShankarSinghC merged 7 commits intomainfrom Mar 24, 2026
Merged
Conversation
build_info crate to obtain cargo workspace membersbuild_info and log_utils crates for build information and logging framework
SanchithHegde
commented
Mar 23, 2026
Comment on lines
+19
to
+21
| let mut workspace_members = build_info::cargo_workspace_members!(); | ||
| workspace_members.extend(build_info::framework_libs_workspace_members()); | ||
| workspace_members.extend(crates_to_filter.iter().copied()); |
Member
Author
There was a problem hiding this comment.
This is to enable logs for crates in this repo, crates from the framework-libs-rs repo and any additional crates passed in crates_to_filter.
| level: config.console.level.into_level(), | ||
| log_format, | ||
| filtering_directive: Some(console_filter_directive), | ||
| print_filtering_directive: DirectivePrintTarget::Stdout, |
Member
Author
There was a problem hiding this comment.
Let me know if you would prefer this printed to stderr, or not printed at all.
Currently, this line is printed to stdout at the beginning:
[INFO] log_utils: Using console filtering directive: WARN,tartarus=DEBUG,locker=DEBUG,hyperswitch_masking=DEBUG,log_utils=DEBUG,tower_http=DEBUG,build_info=DEBUG
Note that this line is printed as is, even if the JSON formatting is enabled.
ShankarSinghC
approved these changes
Mar 24, 2026
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
This PR migrates the code to use libraries from the https://github.com/juspay/framework-libs-rs repository, for obtaining the cargo workspace members and the logging framework.
This PR includes the following changes:
cargo_workspacemodule from the build script and uses thebuild_infocrate instead.log_utilscrate.vergencrate (enabled viabuild_infocrate)..gitignorefile as.dockerignore, so that the git working directory is clean when building the Docker image (git statuswould not report working directory as dirty).Testing
Compared the logs (and fields) for a request on
mainbranch and current branch, and noticed no differences in terms of keys included:Request:
curl -i http://localhost:3001/(Tool used: https://semanticdiff.com/online-diff/json/)
Ran using command
cargo run --features vergen, and confirmed that thebuild_versionfield is present in logs:Confirmed that the version is included in the response headers when run with the
vergenfeature enabled:When no
x-request-idheader is provided, one is generated automatically and is available in response headers:And the same request ID is included in logs:
{ "message": "[REQUEST - EVENT] finished processing request", // ... "request_id": "019d1c0f-3a9a-7ad3-adda-1f0ed29e15bd" }When a value is provided in the
x-request-idheader, it is included in logs and the same is visible in response headers:$ curl -H 'x-request-id: test-request-id' -i http://localhost:3001/ HTTP/1.1 404 Not Found x-request-id: test-request-id x-version: v0.7.0-8-gf5c1cbd7738c-dirty content-length: 0 date: Mon, 23 Mar 2026 18:58:34 GMT{ "message": "[REQUEST - EVENT] finished processing request", // ... "request_id": "test-request-id" }P.S.: I intentionally changed the log formatting to use prettified JSON for readability. Otherwise, as per the changes in the PR, using
jsonlog format would print compact JSON logs itself, not prettified JSON.