Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curl verbose option, repeated use #13977

Closed
wants to merge 1 commit into from
Closed

Conversation

icing
Copy link
Contributor

@icing icing commented Jun 20, 2024

  • make mentioning -vv on the curl command line increase the verbosity of the trace output
  • related discussion Make '-vv..' useful (again) #13810
  • add trace group names for components: network, protocol, proxy. Usable in --trace-config.

Extract from curl's manpage on --verbose:

...
Since curl 8.10, mentioning this option several times in the same argument
increases the level of the trace output. However, as before,
a single -v, --verbose or --no-verbose reverts any additions by
previous -vv again. This means that -vv -v is equivalent to -v. This
avoids unwanted verbosity when the option is mentioned in the command line
and curl config files.

Using it twice, e.g. -vv, will output time (--trace-time) and transfer
ids (--trace-ids), as well as enable tracing for all protocols
(--trace-config protocol).

Adding a third verbose will output transfer content (--trace-ascii %) and
enable tracing of more components (--trace-config read,write,ssl).

A forth time will add tracing of all network components
(--trace-config network).
...

@jay
Copy link
Member

jay commented Jun 20, 2024

You said in #13810 (reply in thread)

I agree that this would change behaviour for people having -v in their .curlrc and adding it on the command line.

IMO we shouldn't do it that way, it's too unexpected and not practical that users will either remember or modify scripts which they may not control to adjust. A verbosity level could be taken from curlrc and then from the command line and go with whichever is greater.

edit: Also it occurs to me multiple --config can be used so I think it should be per file, in other words verbose once in each of two config files should not equal verbosity level 2

@bagder bagder added the feature-window A merge of this requires an open feature window label Jun 22, 2024
@bagder
Copy link
Member

bagder commented Jun 30, 2024

I think this is an interesting take.

I'm thinking maybe we could limit the unexpected side-effects if we make sure to only treat consecutive ones that are adjacent to each other for "leveling", and not ones that are separated by anything. So -vv and -vvv are higher level logging requests, but -v -v is not. That way, having multiple config files setting -v in each will not be affected.

@icing
Copy link
Contributor Author

icing commented Jul 1, 2024

Nice idea. I like it.

@icing
Copy link
Contributor Author

icing commented Jul 1, 2024

Implemented that a single -v, --verbose or --no-verbose undoes all previous effects of a -vv...again.

- make mentioning `-v` on the curl command line increase the
  verbosity of the trace output
- related discussion curl#13810
- make a single -v revert all previous -v+ changes
- make --no-verbose also reset all trace configs
@bagder bagder closed this in 06c5829 Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmdline tool feature-window A merge of this requires an open feature window libcurl API
Development

Successfully merging this pull request may close these issues.

3 participants