| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Sorry, something went wrong.
|
$$build$$ |
Sorry, something went wrong.
Sorry, something went wrong.
|
|
||
| # close_task.exception() is None means that close_task | ||
| # (ws.close()) actually completed without any errors | ||
| assert ws_close_task.exception() is None |
There was a problem hiding this comment.
Maybe add a document for the user of pylibjuju to reconnect from scratch if this happens.
Sorry, something went wrong.
There was a problem hiding this comment.
You mean if this assertion fails?
(in general we only see some error outputs from the websockets library at the teardown for some reason -- not at reconnects)
Sorry, something went wrong.
| msg = result['msg'] | ||
|
|
||
| self.debug_log_target.write("%s %02d:%02d:%02d %s %s %s\n" % (tag, ts.hour, ts.minute, ts.second, sev, mod, msg)) | ||
| log.debug("debug log line is : %s" % result) |
There was a problem hiding this comment.
Do we need this line, with debug on, we'll be double writing?
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah we don't need it, looks like I've forgotten to remove that line I was using when I was writing this 👍 I'll delete it
Sorry, something went wrong.
|
It would be nice to also add more filtering at a later date, but for now, this should be sufficient. |
Sorry, something went wrong.
Oh you're right, I completely forgot about the filtering parameters, nice catch! |
Sorry, something went wrong.
|
$$merge$$ |
Sorry, something went wrong.
#599 2.9.5 ^^^^^ Friday December 3 2021 * remove the event loop arguments by @cderici in #560 * add debug-log by @cderici in #562 * Model status by @juanmanuel-tirado in #563 * Pin cffi version to 1.14.6 for Python 3.5 by @cderici in #570 * Wait for applications to terminate on model reset by @balbirthomas in #572 * Babysitting python3.5 by @cderici in #571 * Deploy charmhub bundles by @cderici in #569 * Facade schemas for 2.9.17 by @SimonRichardson in #579 * Bundles with overlays by @cderici in #566 * Consistently getting a unit's public address by @cderici in #573 * [JUJU-158] Add python3.9 to setup.py by @cderici in #585 * [JUJU-157] Add note for removing services by @cderici in #583 * Added boolean entries to normalize values. by @juanmanuel-tirado in #582 * [JUJU-138] Streamlining asyncio tasks/events by @cderici in #580 * [JUJU-234] Fix for small bug in task handling by @cderici in #589 * Ensure all watchers validate for the Id by @SimonRichardson in #592 * [JUJU-276] Facade schemas for 2.9.19 by @cderici in #594 * [JUJU-238] Small bug fix for old ClientFacade support by @cderici in #593 * [JUJU-239] Debug-log parameters by @cderici in #595 * [JUJU-213] Local type `file` resource support by @cderici in #590 * [JUJU-289] Use provided series in deploy if supported by @jack-w-shaw in #596 * [JUJU-292] Update the charms in the tests to use Charmhub by @cderici in #597 * Legacy "services" for describing "applications" within bundles are no longer supported. "applications" can be used as a direct replacement for "services" in bundles.yaml. * The websocket (ws) in a Connection object became a read-only property. [JUJU-293] [JUJU-158]: https://warthogs.atlassian.net/browse/JUJU-158?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
| Back | FazBrowse Home | New Git URL |
Description
This PR adds debug-log functionality into pylibjuju, by adding a separate Connection object into the Connector of a Model.
User runs await model.debug_log() with a writable target (defaults to stdout), we create a new connection with /log and start the receiving tasks. As the user continues to interact with the model, the debug log receiver tasks write the logs onto whatever target is provided.
Fixes #549
QA Steps
Notes & Discussion
There are two things need to be done before this is ready to merge:
All the tasks need to be flushed before ending the program (that's why we're getting ERROR:asyncio:Future exception was never retrieved errors at the end when we run the example above). This is also closely related to remove the event loop arguments #560 , which I'd prefer to complete and land before I fix this PR.
The filtering parameters of the debug-log (e.g. no-tail, exclude-module, level, lines, etc.) need to be passed through.