This commit is contained in:
Eric 2022-09-15 12:59:36 -07:00
parent d3f3679473
commit fdeb180e9d
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
2 changed files with 10 additions and 9 deletions

View File

@ -36,6 +36,7 @@
- Added `_ba.v1_cloud_log()` which ships a message to the old v1-cloud-log (the log which is gathered and sent to the v1 master server to help me identify problems people are seeing). This is presently wired up to a subset of Python logging output to approximate how it used to work. - Added `_ba.v1_cloud_log()` which ships a message to the old v1-cloud-log (the log which is gathered and sent to the v1 master server to help me identify problems people are seeing). This is presently wired up to a subset of Python logging output to approximate how it used to work.
- Note: Previously in the C++ layer some code would mix Python print calls (such as PyErr_PrintEx()) with ballistica::Log() calls. Previously these all wound up going to the same place (Python's sys.stderr) so it worked, but now they no longer do and so this sort of mixing should be avoided. So if you see a weird combination of colored log output lines with non-colored lines that seem to go together, please holler as it means something needs to be fixed. - Note: Previously in the C++ layer some code would mix Python print calls (such as PyErr_PrintEx()) with ballistica::Log() calls. Previously these all wound up going to the same place (Python's sys.stderr) so it worked, but now they no longer do and so this sort of mixing should be avoided. So if you see a weird combination of colored log output lines with non-colored lines that seem to go together, please holler as it means something needs to be fixed.
- Builds for Apple devices now set a thread stack size of 1MB. The default there is 512k and I was seeing some stack overflows for heavy Physics sims or very recursive Python stuff. - Builds for Apple devices now set a thread stack size of 1MB. The default there is 512k and I was seeing some stack overflows for heavy Physics sims or very recursive Python stuff.
- If you want to grab recent logs, you can now use `ba.app.log_handler.get_cached()` This will give you everything that has gone through Python logging, Python stdout/stderr, and the C++ Log() call (up to the max cache size that is).
### 1.7.6 (build 20687, api 7, 2022-08-11) ### 1.7.6 (build 20687, api 7, 2022-08-11)

View File

@ -146,16 +146,16 @@ class LogHandler(logging.Handler):
self._thread_bootstrapped = True self._thread_bootstrapped = True
self._event_loop.run_forever() self._event_loop.run_forever()
def get_archive(self, def get_cached(self,
start_index: int = 0, start_index: int = 0,
max_entries: int | None = None) -> LogArchive: max_entries: int | None = None) -> LogArchive:
"""Build and return an archive of log entries. """Build and return an archive of cached log entries.
This will only return entries that have been processed by the This will only include entries that have been processed by the
background thread so may not include just-submitted logs. background thread, so may not include just-submitted logs or
Entries in the range [start_index:start_index+max_entries] that entries for partially written stdout/stderr lines.
are still in the cache will be returned. Be aware that this may Entries from the range [start_index:start_index+max_entries]
not be the full requested range. which are still present in the cache will be returned.
""" """
assert start_index >= 0 assert start_index >= 0