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

Allow arbitrary logger types. #51

Merged
merged 10 commits into from
Aug 13, 2023

Conversation

arik-so
Copy link
Contributor

@arik-so arik-so commented Aug 2, 2023

We need the ability to test some deeply nested functionality, such as the return values of queries. The best way to do so is using a test logger and asserting that a given log statement has been made.

Previously, the logger type was globally fixed. With this PR, logger types can be replaced such that the unit test suite will have the ability of using a test-specific logger. Additionally, all print statements needed to be replaced with log statements to make the test-specific logger useful.

// calculate the snapshot
let snapshot = super::serialize_delta(network_graph_clone, current_last_sync_timestamp.clone() as u32).await;
let snapshot = super::serialize_delta(network_graph_clone, current_last_sync_timestamp.clone() as u32, self.logger.clone()).await;
Copy link
Contributor

Choose a reason for hiding this comment

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

Here (and many many places) - you don't always have to clone, sometimes you can just pass by reference and it suffices :).

@TheBlueMatt TheBlueMatt merged commit 55e1b5d into lightningdevkit:main Aug 13, 2023
3 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.

2 participants