Skip to content

feat: Allow users to configure logging level of bitcoin adapter#2310

Merged
ielashi merged 4 commits intomasterfrom
ielashi/btc-adapter-logging
Jul 5, 2022
Merged

feat: Allow users to configure logging level of bitcoin adapter#2310
ielashi merged 4 commits intomasterfrom
ielashi/btc-adapter-logging

Conversation

@ielashi
Copy link
Contributor

@ielashi ielashi commented Jul 4, 2022

Description

The bitcoin adapter's logging can be very verbose if debug logging is enabled, making it difficult to make sense of what's going on. On the other hand, these logs are useful for triaging problems.

To get the best of both worlds, this commit adds support for an additional configuration option in dfx.json:

  "defaults": {
    "bitcoin": {
      "enabled": true,
      "nodes": ["127.0.0.1:18444"],
      "log_level": "info" <------- users can now configure the log level
    },

By default, a log level of "info" is used, which is relatively quiet. Users can change it to "debug" for more verbose logging.

How Has This Been Tested?

I ran dfx start with various configurations of dfx.json and verified from the logs that the bitcoin adapter gets initialized with the expected log level.

Checklist:

  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@ielashi ielashi marked this pull request as ready for review July 4, 2022 15:04
@ielashi ielashi requested a review from a team as a code owner July 4, 2022 15:04
@ielashi ielashi requested review from a user and viviveevee July 5, 2022 13:44
Copy link
Contributor

@viviveevee viviveevee left a comment

Choose a reason for hiding this comment

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

LGTM

@ghost ghost added the automerge-squash label Jul 5, 2022
@ielashi ielashi merged commit 733f7da into master Jul 5, 2022
@ielashi ielashi deleted the ielashi/btc-adapter-logging branch July 5, 2022 17:12
@mergify mergify bot removed the automerge-squash label Jul 5, 2022
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