talaia-labs / rust-teos

The Eye of Satoshi - Lightning Watchtower
https://talaia.watch
MIT License
128 stars 62 forks source link

Add a log lines for datadir, conf file and options #204

Closed anipaul2 closed 1 year ago

anipaul2 commented 1 year ago

fixes: #202

  1. Added the log of default data dir path and where the config file is located
  2. Added the log for non-default options
  3. All tests run successfully
  4. Checked the code with cargo fmt and cargo clippy
anipaul2 commented 1 year ago

Sorry. I'll change it to the requirements and make a pr again.

sr-gi commented 1 year ago

Sorry. I'll change it to the requirements and make a pr again.

No worries. You don't need to create a new PR btw, just append the fixes to this one.

anipaul2 commented 1 year ago

Sorry. I'll change it to the requirements and make a pr again.

No worries. You don't need to create a new PR btw, just append the fixes to this one.

Yes I'll do that only. My midsems exams are ending tomorrow so after that I'll be free. Will give my full time from tomorrow.

anipaul2 commented 1 year ago

@sr-gi please check the updated commit. I updated the requested changes and tested with cargo test and cargo fmt. Also, for non-default options, specifically for this, I referenced it with btc_network when it's not zero.

anipaul2 commented 1 year ago

@sr-gi please check the latest commit.

anipaul2 commented 1 year ago

@sr-gi tested my latest commit and it works fine. Please check once and let me know if I'm still missing something.

sr-gi commented 1 year ago

Something else to have in mind (I just realized about this while testing it) but that can be left for a follow-up: right now we'll be logging something along the lines of:

Custom config arg: key=value

For each arg that has been changed. We should note what made the change, so a follow-up PR should transform that log into either:

Config file arg: key=value

or

Command-line arg: key=value

For context, this is exactly how bitcoind handles it.

anipaul2 commented 1 year ago

Something else to have in mind (I just realized about this while testing it) but that can be left for a follow-up: right now we'll be logging something along the lines of:

Custom config arg: key=value

For each arg that has been changed. We should note what made the change, so a follow-up PR should transform that log into either:

Config file arg: key=value

or

Command-line arg: key=value

For context, this is exactly how bitcoind handles it.

Do I need to modify the get_non_default_options again and take an additional paramater to indicate the source of change (config file or command line), and then include this information in the log output?

anipaul2 commented 1 year ago

@sr-gi Can I squash all commits now?

sr-gi commented 1 year ago

@sr-gi Can I squash all commits now?

Yes, once every comment has been addressed. It should all be a single commit.