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-
jonatack commented at 9:34 pm on April 20, 2020: memberas per #18691 (review), and revert two cli calls changed in #18691 from rpc commands back to command line options (these were the only occurrences).
-
jonatack commented at 9:37 pm on April 20, 2020: memberA 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. -
fanquake added the label Tests on Apr 20, 2020
-
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 beforep_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 afterp_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:Donejonatack force-pushed on Apr 20, 2020jonatack force-pushed on Apr 21, 2020test: 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>
jonatack force-pushed on Apr 21, 2020MarcoFalke commented at 12:40 pm on April 24, 2020: memberACK 8f5dc8800aeb524eee2fa2451cd22883b7b2bfecMarcoFalke merged this on Apr 24, 2020MarcoFalke closed this on Apr 24, 2020
jonatack deleted the branch on Apr 24, 2020sidhujag referenced this in commit 074dad0954 on Apr 24, 2020Fabcien referenced this in commit 05eb8acb90 on Jan 20, 2021DrahtBot locked this on Feb 15, 2022Labels
Tests - Include whether it is
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-12-20 09:12 UTC
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-12-20 09:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me