Skip to content

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

Merged
spernsteiner merged 1 commit into
masterfrom
analyze-println-rewritten-code
Dec 11, 2024
Merged

analyze: use println! instead of info! to print rewritten code#1190
spernsteiner merged 1 commit into
masterfrom
analyze-println-rewritten-code

Conversation

@spernsteiner
Copy link
Copy Markdown
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
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