Cargo: Support `cargo:info=MESSAGE` in `build.rs` stdout

Created on 16 Jun 2019  路  1Comment  路  Source: rust-lang/cargo

Describe the problem you are trying to solve
Provide meaningful information to a developer when using a build.rs script.
In my case, I provide duration of specific steps to monitor the performance of thoses.

Currently, I use cargo:warning=MESSAGE to provide this output.

This is not fine because it is not an actual warning.

Describe the solution you'd like

Supporting cargo:info=MESSAGE to output a string in the cargo's output with info log level.

Example:
(build.rs)

fn main() {
     println!("cargo:info=Hello World!");
}

Will print in the cargo output if the build.rs script is executed:

info: Hello World!

with the look of an info entry.

A-build-scripts C-feature-request

Most helpful comment

This would be quite useful.

>All comments

This would be quite useful.

Was this page helpful?
0 / 5 - 0 ratings