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

analyze: use println! instead of info! to print rewritten code #1190

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

spernsteiner
Copy link
Collaborator

3271b3d replaced all prints in c2rust-analyze with info! or other logging calls. This generally makes it easier to filter the debug output. However, using info! for printing the rewritten code adds a prefix to each line:

[INFO @ c2rust-analyze/src/rewrite/mod.rs:349 @ c2rust_analyze::rewrite]: extern crate libc;
[INFO @ c2rust-analyze/src/rewrite/mod.rs:349 @ c2rust_analyze::rewrite]: extern "C" {
[INFO @ c2rust-analyze/src/rewrite/mod.rs:349 @ c2rust_analyze::rewrite]:     fn malloc(_: libc::c_ulong) -> *mut libc::c_void;
[INFO @ c2rust-analyze/src/rewrite/mod.rs:349 @ c2rust_analyze::rewrite]: }

This makes it hard to copy-paste the rewritten code into a separate .rs file for testing or debugging.

This branch changes the output of rewritten code from info! back to println!.

@spernsteiner spernsteiner force-pushed the analyze-println-rewritten-code branch from 8c054f7 to d4ede01 Compare December 10, 2024 17:48
@spernsteiner spernsteiner merged commit 1e6ce6f into master Dec 11, 2024
9 checks passed
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.

2 participants