Skip to content

config: Add SERVO_DIAGNOSTICS environment variable for diagnostic options#41013

Merged
atbrakhi merged 1 commit intoservo:mainfrom
atbrakhi:add_env_variable_parser
Dec 4, 2025
Merged

config: Add SERVO_DIAGNOSTICS environment variable for diagnostic options#41013
atbrakhi merged 1 commit intoservo:mainfrom
atbrakhi:add_env_variable_parser

Conversation

@atbrakhi
Copy link
Copy Markdown
Member

@atbrakhi atbrakhi commented Dec 2, 2025

With this change can now configure diagnostic logging via the SERVO_DIAGNOSTICS environment variable in addition to the existing -Z command-line flag.

The environment variable accepts the same comma-separated options as -Z (e.g., SERVO_DIAGNOSTICS=style-tree,display-list). The help option works from both sources and will display all available diagnostic flags.

Environment variable parsing is disabled in production builds

Testing: Tested locally for release, debug and production build to make sure it is disabled for production
Fixes: Part of #40863

@atbrakhi
Copy link
Copy Markdown
Member Author

atbrakhi commented Dec 2, 2025

@Narfinger
Copy link
Copy Markdown
Contributor

I wonder if it would be good to have that somewhere in the servo book.

@atbrakhi atbrakhi marked this pull request as ready for review December 2, 2025 15:55
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 2, 2025
@atbrakhi
Copy link
Copy Markdown
Member Author

atbrakhi commented Dec 2, 2025

I wonder if it would be good to have that somewhere in the servo book.

I am sure it will be helpful. I will add it

@atbrakhi atbrakhi requested a review from mrobinson December 2, 2025 15:58
Copy link
Copy Markdown
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

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

Looks good, but I think you can simplify this a bit. Thanks!

@atbrakhi atbrakhi force-pushed the add_env_variable_parser branch from 2ca43a7 to b59dff3 Compare December 4, 2025 11:49
@atbrakhi atbrakhi requested a review from mrobinson December 4, 2025 11:50
Copy link
Copy Markdown
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

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

Thanks!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Dec 4, 2025
@atbrakhi atbrakhi force-pushed the add_env_variable_parser branch from b59dff3 to a43dd72 Compare December 4, 2025 14:17
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 4, 2025
@atbrakhi atbrakhi enabled auto-merge December 4, 2025 14:18
@atbrakhi atbrakhi added this pull request to the merge queue Dec 4, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 4, 2025
Merged via the queue into servo:main with commit cb5f47e Dec 4, 2025
32 checks passed
@atbrakhi atbrakhi deleted the add_env_variable_parser branch December 4, 2025 15:08
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 4, 2025
github-merge-queue bot pushed a commit to servo/book that referenced this pull request Dec 18, 2025
Add documentation for `SERVO_DIAGNOSTICS`. See
[#41013](servo/servo#41013)

Signed-off-by: atbrakhi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants