Open
Conversation
davidbarsky
commented
Apr 23, 2023
Comment on lines
+404
to
+409
| let level = match _level { | ||
| 0 => tracing::Level::TRACE, | ||
| 1 => tracing::Level::DEBUG, | ||
| 2 => tracing::Level::INFO, | ||
| 3 => tracing::Level::WARN, | ||
| 4 => tracing::Level::ERROR, |
Author
There was a problem hiding this comment.
Note that this the opposite of what's happening inside of the (since-deleted) logging.rs—both log and tracing treat the most verbose level as the lowest usize, but logging did the opposite (0 is ERROR).
I put up this PR as-is since I'm not sure what the usage of this is over on d2foundry (and since log/tracing have one more logging level than D2_Calculation_API, starting at 0 would result in an off-by-one-error semantic error anyways).
In any case, I'm happy to change this section however you'd like me to.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just a thing that was discussed in Discord.
As an aside—if it's useful—I've found that the experience of developing a Rust codebase with support for different with FFI'd targets is to have a Rust code and a crate for each language you're binding to. If you'd like, I'd be happy to send over a PR with those changes. It'll mean you'd probably be able to get rid of the
#![allow(dead_code)]/#![allow(unused_imports)] and get the non-additive feature flags—rust-analyzer will probably work better as well.(Of course, if you don't want a random-drive-by refactoring, that's also fine too! I can imagine that'd be pretty annoying.)