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

Drop log-limiting features #3431

Merged

Conversation

tnull
Copy link
Contributor

@tnull tnull commented Nov 28, 2024

Fixes #3424.

Previously, LDK offered two ways to limit log outputs: filtering during runtime client-side by matching on any given Record's Level value, as well as at compile time through the max_level_* feature flags.

It turns out the latter approach was always broken when used outside of the lightning crate. Here, we therefore simply drop the feature-based filtering.

@tnull tnull added this to the 0.1 milestone Nov 28, 2024
@tnull tnull requested a review from TheBlueMatt November 28, 2024 10:59
@tnull
Copy link
Contributor Author

tnull commented Nov 28, 2024

@TheBlueMatt Let me know if this is reasonable. I think if we want to re-enable compile-time limiting we could do so by defining a limit as an associated type on Logger? This would have the added benefit of breaking the Logger API, i.e., users would be made aware of the behavior change they might need to act on.

Copy link

@enigbe enigbe left a comment

Choose a reason for hiding this comment

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

I have reviewed this. Looks good to me.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

I think this is fine, yea.

@@ -185,23 +185,12 @@ macro_rules! log_internal {
macro_rules! log_given_level {
($logger: expr, $lvl:expr, $($arg:tt)+) => (
match $lvl {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can drop the match now, 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.

Ah, indeed. It seems we can actually drop the entire log_given_level macro now.

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.48%. Comparing base (0c31021) to head (f6af8e3).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3431      +/-   ##
==========================================
+ Coverage   89.22%   90.48%   +1.26%     
==========================================
  Files         130      130              
  Lines      106965   111765    +4800     
  Branches   106965   111765    +4800     
==========================================
+ Hits        95438   101131    +5693     
+ Misses       8734     8252     -482     
+ Partials     2793     2382     -411     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheBlueMatt
Copy link
Collaborator

LGTM, feel free to squash.

Previously, LDK offered two ways to limit log outputs:
filtering during runtime client-side by matching on any given `Record`'s `Level` value,
as well as at compile time through the `max_level_*` feature flags.

It turns out the latter approach was always broken when used outside of
the `lightning` crate. Here, we therefore simply drop the feature-based
filtering.
@tnull tnull force-pushed the 2024-11-drop-logging-features branch from 3afc3de to f6af8e3 Compare December 3, 2024 16:26
@tnull
Copy link
Contributor Author

tnull commented Dec 3, 2024

LGTM, feel free to squash.

Squashed fixups without further changes.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Thanks. Simple enough and fixes CI issues.

@TheBlueMatt TheBlueMatt merged commit 1386bef into lightningdevkit:main Dec 3, 2024
16 of 17 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.

fuzz: libFuzzer build failure "unexpected cfg condition value: max_level_*"
3 participants