cli: show default values in config args log #18611

pull brakmic wants to merge 1 commits into bitcoin:master from brakmic:compare-params changing 2 files +26 −1
  1. brakmic commented at 8:57 PM on April 12, 2020: contributor

    This PR expands the config args listing that shows up at boot. The motivation for this PR is based on this old issue from 2016: #8165

    However, this PR isn't changing anything in the UI and only changes the output of the config args list in debug.log.

    The proposed config arg list would like this:

    2020-04-12T20:35:30Z Config file arg: [main] daemon="1"
    2020-04-12T20:35:30Z Config file arg: [main] deprecatedrpc="signrawtransaction"
    2020-04-12T20:35:30Z Config file arg: [main] listen="1", default=1
    2020-04-12T20:35:30Z Config file arg: [main] port="8444", default=8333
    2020-04-12T20:35:30Z Config file arg: [main] prune="550", default=0
    2020-04-12T20:35:30Z Config file arg: [main] rest="1", default=0
    2020-04-12T20:35:30Z Config file arg: [main] rpcallowip="127.0.0.1"
    2020-04-12T20:35:30Z Config file arg: [main] rpcbind=****, default=127
    2020-04-12T20:35:30Z Config file arg: [main] rpcpassword=****
    2020-04-12T20:35:30Z Config file arg: [main] rpcport="8445", default=8332
    2020-04-12T20:35:30Z Config file arg: [main] rpcuser=****
    2020-04-12T20:35:30Z Config file arg: [main] server="1"
    2020-04-12T20:35:30Z Config file arg: [regtest] blockfilterindex="basic", default=0
    2020-04-12T20:35:30Z Config file arg: [regtest] daemon="0"
    2020-04-12T20:35:30Z Config file arg: [regtest] listen="1", default=1
    2020-04-12T20:35:30Z Config file arg: [regtest] rest="1", default=0
    2020-04-12T20:35:30Z Config file arg: [regtest] rpcallowip="127.0.0.1"
    2020-04-12T20:35:30Z Config file arg: [regtest] rpcbind=****, default=127
    2020-04-12T20:35:30Z Config file arg: [regtest] server="1"
    2020-04-12T20:35:30Z Config file arg: [regtest] upnp="0", default=0
    2020-04-12T20:35:30Z Config file arg: [test] daemon="1"
    2020-04-12T20:35:30Z Config file arg: [test] deprecatedrpc="signrawtransaction"
    2020-04-12T20:35:30Z Config file arg: [test] listen="1", default=1
    2020-04-12T20:35:30Z Config file arg: [test] prune="550", default=0
    2020-04-12T20:35:30Z Config file arg: [test] rest="1", default=0
    2020-04-12T20:35:30Z Config file arg: [test] rpcallowip="127.0.0.1"
    2020-04-12T20:35:30Z Config file arg: [test] rpcbind=****, default=127
    2020-04-12T20:35:30Z Config file arg: [test] server="1"
    

    Only those args that have default values set will be extended with a default= entry.

    The current implementation is using a simple regex to extract default values from available argument descriptions.

  2. DrahtBot commented at 10:06 PM on April 12, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #16673 (Relog configuration args on debug.log rotation by LarryRuane)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  3. DrahtBot added the label Utils/log/libs on Apr 12, 2020
  4. cli: show default values in config args log 3b2489d795
  5. luke-jr commented at 5:25 PM on April 23, 2020: member

    When we add defaults, I think we should show all options, not just ones the user has changed.

    Also, this can't handle complex defaults (eg, "1 unless -connect used"), so I think it's not necessarily a step in the right direction...

    Maybe instead, it should iterate all the options in order, printing the current value, and where that value came from (default including soft-set, config, or command line)?

  6. brakmic commented at 6:24 PM on April 23, 2020: contributor

    Many thanks, @luke-jr !

    I will then try to implement the points you mentioned. Will also make this PR a "draft".

    When we add defaults, I think we should show all options, not just ones the user has changed.

    Also, this can't handle complex defaults (eg, "1 unless -connect used"), so I think it's not necessarily a step in the right direction...

    Maybe instead, it should iterate all the options in order, printing the current value, and where that value came from (default including soft-set, config, or command line)?

  7. brakmic marked this as a draft on Apr 23, 2020
  8. brakmic closed this on May 10, 2020

  9. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me