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

revert: removes date from & symlink to log files #394

Merged

Conversation

enigbe
Copy link
Contributor

@enigbe enigbe commented Oct 31, 2024

What this PR does:

Reverts the changes introduce by #116 which added the dates to log files whenever the node is started & a symlink to track the latest log file. This reversal is necessary to simplify the work required to integrate with OS-level log tools.

Related Issue

@enigbe enigbe marked this pull request as draft October 31, 2024 17:07
@enigbe enigbe force-pushed the revert-filesystem-logging-to-simple-file branch from 57a04f1 to ee51f47 Compare October 31, 2024 17:08
@enigbe enigbe marked this pull request as ready for review October 31, 2024 17:30
)

This commit reverts the changes introduce by PR lightningdevkit#116 which added the
date to log files when the node is started & a symlink to track the latest log
file. This reversal is necessary to simplify the work required to integrate with
OS-level log tools.
@enigbe enigbe force-pushed the revert-filesystem-logging-to-simple-file branch from ee51f47 to 24cf565 Compare October 31, 2024 17:31
@@ -1231,6 +1231,8 @@ fn build_with_store_internal(
})
}

/// Sets up the node logger, creating a new log file if it does not exist, or utilizing
/// the existing log file.
fn setup_logger(config: &Config) -> Result<Arc<FilesystemLogger>, BuildError> {
let log_dir = match &config.log_dir_path {
Some(log_dir) => String::from(log_dir),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Github won't comment on the line below this, but let's drop the {storage_path_dir}/logs folder now that we'll only have one log file. Rather, let's just default to {storage_path_dir}/ldk_node.log.

@enigbe enigbe force-pushed the revert-filesystem-logging-to-simple-file branch from 109ab9c to c030775 Compare November 3, 2024 23:04
@enigbe enigbe force-pushed the revert-filesystem-logging-to-simple-file branch from c030775 to dc9f840 Compare November 3, 2024 23:17
@enigbe enigbe requested a review from tnull November 4, 2024 10:15
Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Basically LGTM I think.

One question, up to to you.

tests/integration_tests_rust.rs Show resolved Hide resolved
Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Basically LGTM

src/builder.rs Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
src/logger.rs Outdated Show resolved Hide resolved
- In addition, update docs for `ArcedNodeBuilder::set_log_file_path`
@tnull
Copy link
Collaborator

tnull commented Nov 7, 2024

Thank you for the updates, mind rebasing on main to make CI pass? (just merged #399)

@enigbe enigbe force-pushed the revert-filesystem-logging-to-simple-file branch 2 times, most recently from fc4aeb9 to 1eedcce Compare November 8, 2024 04:43
@enigbe enigbe force-pushed the revert-filesystem-logging-to-simple-file branch from 1eedcce to f033ba2 Compare November 8, 2024 05:27
Copy link
Collaborator

@tnull tnull left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

There is one minor nit, but given that we'll do larger refactoring on this anyways, this can be addressed some other time.

fn setup_logger(config: &Config) -> Result<Arc<FilesystemLogger>, BuildError> {
let log_dir = match &config.log_dir_path {
let log_file_path = match &config.log_file_path {
Some(log_dir) => String::from(log_dir),
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: This variable names should be adjusted to reflect it's now a file path, not the dir path anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apologies for this. I'll address in another PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No worries at all, let's just include a fixup commit in whatever logging-related PR you open next!

@tnull tnull merged commit 60dffa8 into lightningdevkit:main Nov 8, 2024
12 of 13 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