Skip to content

Conversation

neiljp
Copy link
Collaborator

@neiljp neiljp commented Aug 2, 2020

Previously the zulip-terminal-traceback.log file was polluted with urllib3/requests debug messages. This separates these two sources.

In future, we could enable API call logging only in a debug or development mode.

We could potentially do the latter sooner rather than later - thoughts?

@zulipbot zulipbot added the size: M [Automatic label added by zulipbot] label Aug 2, 2020
@neiljp neiljp force-pushed the 2020-08-01-separate-loggers branch from 71e348d to fbbe9ba Compare August 2, 2020 01:53
@neiljp neiljp added the PR needs review PR requires feedback to proceed label Aug 2, 2020
Copy link
Member

@preetmishra preetmishra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neiljp Thanks for extracting the API log. I tested this locally and it seems to work well. This would surely make debugging easier. 👍

I believe logging API calls only in the debug/development mode seems reasonable.

@neiljp neiljp force-pushed the 2020-08-01-separate-loggers branch 2 times, most recently from 9159509 to 487b094 Compare August 2, 2020 22:28
@neiljp
Copy link
Collaborator Author

neiljp commented Aug 2, 2020

@preetmishra Thanks for the review 👍

Updated to use the more specific file and variable names, and only show API calls in debug mode.

@neiljp neiljp added this to the Next Release milestone Aug 2, 2020
Copy link
Member

@preetmishra preetmishra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neiljp Thanks for the amendments. I tested it locally and it works as expected. The commit looks good too. 👍

Let's add zulip-terminal-API-requests.log to our .gitignore before merging. 🎉

Previously the zulip-terminal-traceback.log file was polluted with
urllib3/requests debug messages. This separates these two sources.

The files are currently set as:
* zulip-terminal-API-requests.log - urllib3 events (API calls)
* zulip-terminal-tracebacks.log - exceptions specific to ZT

The API log file is only generated when debug mode is enabled
(-d/--debug), and the traceback log file is only opened when an
exception gets logged (delay=True). When non-developer users run ZT,
this should minimize the generated log files unless specifically
requested or in case of bugs.

Additional log file added to .gitignore.
@neiljp neiljp force-pushed the 2020-08-01-separate-loggers branch from 487b094 to f62515b Compare August 3, 2020 18:44
@neiljp
Copy link
Collaborator Author

neiljp commented Aug 3, 2020

@preetmishra I have quite some extra files so .gitignore doesn't show a clean tree often, so thanks for the reminder 👍

@neiljp neiljp merged commit 7efcc7f into zulip:master Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR needs review PR requires feedback to proceed size: M [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants