test: display command line options passed to send_cli() in debug log #18712

pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:log-cli-options changing 2 files +3 −3
  1. jonatack commented at 9:34 pm on April 20, 2020: member
    as per #18691 (review), and revert two cli calls changed in #18691 from rpc commands back to command line options (these were the only occurrences).
  2. jonatack commented at 9:37 pm on April 20, 2020: member
    A good way to test this is to run test/functional/interface_bitcoin_cli.py --loglevel debug, which is the only place currently where these calls are used.
  3. fanquake added the label Tests on Apr 20, 2020
  4. in test/functional/test_framework/test_node.py:585 in 2e45626831 outdated
    579@@ -580,7 +580,8 @@ def send_cli(self, command=None, *args, **kwargs):
    580         if command is not None:
    581             p_args += [command]
    582         p_args += pos_args + named_args
    583-        self.log.debug("Running bitcoin-cli command: %s" % command)
    584+        options_to_log = '' if not self.options else ', options: ' + ', '.join(self.options)
    585+        self.log.debug("Running bitcoin-cli command: {}{}".format(command, options_to_log))
    


    MarcoFalke commented at 10:25 pm on April 20, 2020:
    Might as well just log p_args[2:] or so, because -named is an option as well

    jonatack commented at 10:48 pm on April 20, 2020:
    Done, set before p_args += [command] to not log the command in the options as well.

    jonatack commented at 10:52 pm on April 20, 2020:
    Do you think it’s more useful to set it after p_args += pos_args + named_args and remove the command from the list?

    MarcoFalke commented at 11:39 pm on April 20, 2020:
    0self.log.debug("Running bitcoin-cli {}".format(p_args[2:]))
    

    should do all the things:

    • Include whether it is -named or not
    • Include all args, like --tracerpc
    • Include the command

    jonatack commented at 0:03 am on April 21, 2020:
    Done
  5. jonatack force-pushed on Apr 20, 2020
  6. jonatack force-pushed on Apr 21, 2020
  7. test: display command line options passed to send_cli() in debug log
    and fixup two cli calls from rpc commands to command line options.
    
    Co-authored-by: MarcoFalke <falke.marco@gmail.com>
    8f5dc8800a
  8. jonatack force-pushed on Apr 21, 2020
  9. MarcoFalke commented at 12:40 pm on April 24, 2020: member
    ACK 8f5dc8800aeb524eee2fa2451cd22883b7b2bfec
  10. MarcoFalke merged this on Apr 24, 2020
  11. MarcoFalke closed this on Apr 24, 2020

  12. jonatack deleted the branch on Apr 24, 2020
  13. sidhujag referenced this in commit 074dad0954 on Apr 24, 2020
  14. Fabcien referenced this in commit 05eb8acb90 on Jan 20, 2021
  15. 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: 2024-11-18 03:12 UTC

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