You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reopening this since --debug does not clearly imply that its output shows the request path taken by the to-be-executed command. Also it's worth discussion that what kind of logs should we add to --verbose
Both me and @toddysm were confused as to why --verbose didn't have any output. I understand that --debug has the output but the main point here is layered exposure of detailed logging. Possibly even differently formatted logs. e.g. raw json response could be included in --debug. Also, I think verbose logging might even benefit if its human readable.
Typically, I consider when --debug is enabled, the command will output much more detailed and technical information about what it is doing, including internal state, API calls, and other low-level details. This can be useful for developers or advanced users who need to debug or diagnose issues with a command or operation and possibly include timing information.
curl doesn't have --debug and --verbose. The only option is --verbose and it is very helpful to track the HTTP request/response. As @sajayantony mentions above, having the --verbose option with no changes in output is weird. Also, there is no clarity what is the purpose of it. We have two scenarios here:
Getting troubleshooting information for the API exchange or the steps the tool performs. In this case we can use --debug as until now or --verbose as curl does (as well as other tools).
Adding additional details from command outputs that can be beneficial for users. This is --detailed output though and not --verbose IMHO. Example is:
oras discover ... -o tree shows only the tree with the digests
oras discover ... -o tree --detailed shows also annotations
Designing on the fly above but trying to convey what the experience can be.
I don't think we need both --debug and --verbose. --verbose should be enough for the purposes and it is consistent with other tools. We should not introduce --debug in the future because it is confusing.
--detailed was just an example trying to illustrate a scenario where we can suppress some output that is helpful for the user. I don't think we need to add this right now because it is not properly designed.
So basically, if --debug logs are merged into --verbose and we don't have another flag like --detailed, oras user will get output 3 or 2, with or without --verbose set respectively. But they won't be able to get output 1.
Hey folks, I wanted to chime in on this thread as I was recently trying to use oras to troubleshoot an issue. I ended up not getting the output that I needed and tried to use crane instead and found it to be more helpful. Here is an example I saw from crane using the same artifact that @qweeah showed in the earlier comment.
Having newlines separate the output of each request/response is much easier to read
The first line of each request/response is informative and makes it easy to understand the context of the subsequent output. For example, 2024/02/16 01:35:17 --> GET https://index.docker.io/v2/library/hello-world/manifests/latest and 2024/02/16 01:35:17 <-- 200 https://index.docker.io/v2/library/hello-world/manifests/latest (127.026832ms). The oras output does not show the timestamp of each request.
The crane output is presented in order which makes it easy to follow what happen. The oras output may be presented out of order which means you may have to scroll back and forth to see the request and response.
The crane output also shows the body of the response when relevant, such as manifest or token responses. While it may be a bit noisy, it is desirable to have in a verbose context
As discussed above, it wasn't clear to me that oras --debug would be equivalent to crane --verbose. At first, I attempted to use oras --verbose and saw that it didn't have the request and responses, so I moved to crane. It wasn't until I found this issue that I realized oras actually had this capability. So I think it may make sense to either consolidate these options or allow for different levels of verbosity.
If I have time, I may submit PR to propose some of the changes in the feedback. Let me know what your thoughts are.
Reacted by Sajay Antony, Feynman Zhou, Yi Zha, Billy Zha and Lixia (Sylvia) Lei
I’ve been proposing to drop ORAS debug from basics scenarios and enhance all to —verbose scenario. Debug IMHO should be for ORAS lib or CLI developers not for registry or target debugging. Feel free to PR this @ridhoq.
Activity
qweeah commentedon Apr 2, 2023
supported via
oras blob fetch --debug/-dqweeah commentedon Apr 4, 2023
Reopening this since
--debugdoes not clearly imply that its output shows the request path taken by the to-be-executed command. Also it's worth discussion that what kind of logs should we add to--verbosesajayantony commentedon Apr 4, 2023
Both me and @toddysm were confused as to why --verbose didn't have any output. I understand that --debug has the output but the main point here is layered exposure of detailed logging. Possibly even differently formatted logs. e.g. raw json response could be included in --debug. Also, I think verbose logging might even benefit if its human readable.
Typically, I consider when --debug is enabled, the command will output much more detailed and technical information about what it is doing, including internal state, API calls, and other low-level details. This can be useful for developers or advanced users who need to debug or diagnose issues with a command or operation and possibly include timing information.
toddysm commentedon Apr 4, 2023
curldoesn't have--debugand--verbose. The only option is--verboseand it is very helpful to track the HTTP request/response. As @sajayantony mentions above, having the--verboseoption with no changes in output is weird. Also, there is no clarity what is the purpose of it. We have two scenarios here:--debugas until now or--verboseascurldoes (as well as other tools).--detailedoutput though and not--verboseIMHO. Example is:oras discover ... -o treeshows only the tree with the digestsoras discover ... -o tree --detailedshows also annotationsDesigning on the fly above but trying to convey what the experience can be.
qweeah commentedon Apr 4, 2023
Trying to understand the proposed change:
--debugto--verbose--detailedto show current verbose output (update: this is not needed)--debugfor more low-level and technical information@toddysm @sajayantony Can you help confirm?
toddysm commentedon Apr 4, 2023
I don't think we need both
--debugand--verbose.--verboseshould be enough for the purposes and it is consistent with other tools. We should not introduce--debugin the future because it is confusing.--detailedwas just an example trying to illustrate a scenario where we can suppress some output that is helpful for the user. I don't think we need to add this right now because it is not properly designed.Hope this helps.
qweeah commentedon Apr 4, 2023
Below is the output of
oras cpwith and without--verboseIf we merging
--debugoutput into--verbose, below is a sample output oforas cpSo basically, if
--debuglogs are merged into--verboseand we don't have another flag like--detailed, oras user will get output 3 or 2, with or without--verboseset respectively. But they won't be able to get output 1.toddysm commentedon Apr 4, 2023
We got this scenario completely wrong (see #916) Output 2 is very misleading from user point of view. The default should be output 1.
[-]Add verbose http logging to blob fetch[/-][+]Improve verbose logging for oras commands[/+][-]Improve verbose logging for oras commands[/-][+] Add verbose http logging to blob fetch[/+]ridhoq commentedon Feb 16, 2024
Hey folks, I wanted to chime in on this thread as I was recently trying to use
orasto troubleshoot an issue. I ended up not getting the output that I needed and tried to usecraneinstead and found it to be more helpful. Here is an example I saw fromcraneusing the same artifact that @qweeah showed in the earlier comment.Crane output
Feedback
2024/02/16 01:35:17 --> GET https://index.docker.io/v2/library/hello-world/manifests/latestand2024/02/16 01:35:17 <-- 200 https://index.docker.io/v2/library/hello-world/manifests/latest (127.026832ms). Theorasoutput does not show the timestamp of each request.craneoutput is presented in order which makes it easy to follow what happen. Theorasoutput may be presented out of order which means you may have to scroll back and forth to see the request and response.craneoutput also shows the body of the response when relevant, such as manifest or token responses. While it may be a bit noisy, it is desirable to have in a verbose contextoras --debugwould be equivalent tocrane --verbose. At first, I attempted to useoras --verboseand saw that it didn't have the request and responses, so I moved tocrane. It wasn't until I found this issue that I realizedorasactually had this capability. So I think it may make sense to either consolidate these options or allow for different levels of verbosity.If I have time, I may submit PR to propose some of the changes in the feedback. Let me know what your thoughts are.
sajayantony commentedon Feb 16, 2024
I’ve been proposing to drop ORAS debug from basics scenarios and enhance all to —verbose scenario. Debug IMHO should be for ORAS lib or CLI developers not for registry or target debugging. Feel free to PR this @ridhoq.
TerryHowe commentedon Apr 11, 2024
It would be convenient if debug logging was routed to stderr so if a user is parsing output, they don't have to sort though that.
TerryHowe commentedon Aug 22, 2024
Related #1483
FeynmanZhou commentedon Nov 27, 2024
Hi @sajayantony , this issue has been included in the "Problem Statement" of the spec Improve ORAS diagnose experience and planned to be resolved in v1.3.0-beta.1.