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

Improve the format of --debug logs #1535

Closed
Wwwsylvia opened this issue Nov 21, 2024 · 0 comments · Fixed by #1559
Closed

Improve the format of --debug logs #1535

Wwwsylvia opened this issue Nov 21, 2024 · 0 comments · Fixed by #1559
Assignees
Labels
enhancement New feature or request logging
Milestone

Comments

@Wwwsylvia
Copy link
Member

As per the ORAS diagnose experience proposal, we should improve the format of the --debug logs as below:

- Add two empty lines as the separator between each request and response for readability.
- Add timestamp of each request and response to the beginning of each request and response.
- Print out the response body in the debug logs if the [Content-Type](https://www.rfc-editor.org/rfc/rfc2616#section-14.17) of the HTTP response body is JSON or plain text format. ORAS SHOULD limit the size of a response body for preventing clients from overloading the registry server with massive payloads that could lead to performance issues.
- Upon a response with failures, the [error code](https://github.com/opencontainers/distribution-spec/blob/main/spec.md#error-codes) should be included in the response body by default for diagnose purposes.
- Considering ORAS is not a daemon service so parsing debug logs to a logging system is not a common scenario. The target users of the debug logs are normal users and ORAS developers. Thereby, the debug logs in TTY mode and non-TTY (`--no-tty`) should be consistent, except for the color. Specifically, debug logs SHOULD be colored-code in a TTY mode for better readability on terminal but keeping plain text in a non-TTY mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request logging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants