Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add build-print feature to enable logging in build.rs scripts #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elcoosp
Copy link

@elcoosp elcoosp commented Mar 17, 2025

This PR introduces a new optional build-print feature, allowing users to capture and display logs generated during build.rs execution.

Changes

  • Adds build-print as an optional dependency, conditionally enabling it via the Cargo feature flag.

  • Updates logging macros (debug!, trace!) to route output through build-print when the feature is active, ensuring logs appear during build scripts.

  • Maintains backward compatibility by falling back to standard log crate behavior when build-print is not enabled.

Usage

Enable the feature in your Cargo.toml:

[dependencies.rust_cmd_lib]
features = ["build-print"]

This is particularly useful for debugging build-time logic or tracking output from custom build.rs workflows.

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.

1 participant