-
Notifications
You must be signed in to change notification settings - Fork 120
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 debug logging #3361
Improve debug logging #3361
Conversation
Set to draft; |
Question for the reviewer: would it be worth to define the colors on a single place? This code isn't updated often, and it is quite isolated, so maybe it is enough, as it has been for several years now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I would define colors on single place. Maybe it could be useful for other parts of code. We could make output of subscription-manager more colorful.
src/rhsm/connection.py
Outdated
msg += ( | ||
red_col | ||
+ " https://" | ||
+ "https://" | ||
+ f"{normalized_host(self.host)}:{safe_int(self.ssl_port)}{handler} {request_type}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are significantly changing debug printing, then please print request_type
first to get something like this:
Request:
GET https://centos8-candlepin:8443/candlepin/ (using consumer auth)
70110fd
to
7f837cc
Compare
This change clearly labels each section that's printed to make it easier to identify the interesting parts. This also adds SUBMAN_DEBUG_PRINT_TRACEBACKS flag to print the traceback directly to stdout. GREEN: title RED: method + url (request), status code (response) BLUE: headers YELLOW: body WHITE: call stack
7f837cc
to
22e5630
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks for updates 👍
This change clearly labels each section that's printed to make it easier to identify the interesting parts.
This also adds SUBMAN_DEBUG_PRINT_TRACEBACKS flag to print the traceback directly to stdout.
Example:
(the white horizontal line is just result of putting two screenshots together, the traceback was too long)