-
Notifications
You must be signed in to change notification settings - Fork 421
Provide a utility to log the ProbabilisticScorer's contents #1460
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
Provide a utility to log the ProbabilisticScorer's contents #1460
Conversation
2a87d5e to
b45c5ed
Compare
Codecov Report
@@ Coverage Diff @@
## main #1460 +/- ##
==========================================
+ Coverage 90.88% 92.03% +1.14%
==========================================
Files 75 75
Lines 41517 46637 +5120
Branches 41517 46637 +5120
==========================================
+ Hits 37734 42921 +5187
+ Misses 3783 3716 -67
Continue to review full report at Codecov.
|
vincenzopalazzo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Question: There is any way from the application layer to disable the log? dummy question,, sorry
d254510
dunxen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK d254510
The function isn't called anywhere, so an application would have to explicitly call it. In general, logging is configured using rust features: rust-lightning/lightning/Cargo.toml Line 20 in 9bdce47
@TheBlueMatt The comment there is a little confusing. Perhaps it could be reworded? |
Agreed, those should be reworded. Really they need to be copied into the library-level |
I wrote this when debugging a user's scorer and figured it may be useful upstream.
ea442e1 to
75c3df0
Compare
|
Squashed fixup commits. |
|
Given this function isn't called or tested anywhere, are we running the risk of deleting it later on because it looks like dead code? Should it perhaps have at least one call site somewhere? |
| let graph = self.network_graph.read_only(); | ||
| for (scid, liq) in self.channel_liquidities.iter() { | ||
| if let Some(chan_debug) = graph.channels().get(scid) { | ||
| let log_direction = |source, target| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for not making this a macro :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm often in macro debugging hell and I hate it :(
|
I don't think we'd just delete something that's a pub fn? The same could be said for most pub fns, no? You could argue about testing, but its just a test util and it should fail to compile in some way if we change the API. |
I wrote this when debugging a user's scorer and figured it may be
useful upstream.