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

Rust log to core #3432

Merged
merged 5 commits into from
Jun 2, 2022
Merged

Rust log to core #3432

merged 5 commits into from
Jun 2, 2022

Conversation

graydon
Copy link
Contributor

@graydon graydon commented May 20, 2022

This builds on the back of #3428 by connecting the Rust standard log crate API to the stellar-core logging subsystem, allowing us to fairly normally write info!(...) calls in Rust and have them come out of spdlog.

Along the way it adds a little bit of additional plumbing in the bridge module and renames C++ bridging-related files yet again (hopefully for the last time) to match our CamelCase naming convention on C++ files.

@graydon graydon requested a review from MonsieurNicolas May 20, 2022 00:50
@graydon graydon force-pushed the rust-log-to-core branch from 5acea12 to 6752e51 Compare May 20, 2022 00:55
@graydon graydon mentioned this pull request May 20, 2022
@graydon graydon force-pushed the rust-log-to-core branch 3 times, most recently from 062be39 to 754f1cf Compare May 21, 2022 01:41
@graydon graydon force-pushed the rust-log-to-core branch from 754f1cf to 51009b0 Compare May 25, 2022 02:10
{
log::set_logger(&LOGGER)?;
}
log::set_max_level(maxFilter);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should also be getting called when Logging::setLogLevel is called, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, any time you change anything in the logging system it gets "deinitialized" and "reinitialized" in the C++ Logging.cpp / spdlog side. That's why there's the HAVE_INITIALIZED bool in the Rust side, to prevent multiple-initialization.

@jonjove
Copy link
Contributor

jonjove commented Jun 2, 2022

There's one open question that only impacts the rust side, not the C++ side. So I'm going to merge.

@jonjove
Copy link
Contributor

jonjove commented Jun 2, 2022

r+ 51009b0

@latobarita latobarita merged commit c67006e into stellar:master Jun 2, 2022
@graydon graydon deleted the rust-log-to-core branch July 4, 2022 23:29
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.

3 participants