Generate a seperate log message per dumped object for profiler.dump_log_objects (#90867)

Since some objects are very large we can generate overly large log messages
```
Event data for system_log_event exceed maximum size of 32768 bytes. This can cause database performance issues; Event data will not be stored
```

Reported in https://ptb.discord.com/channels/330944238910963714/427516175237382144/1093069996101472306
This commit is contained in:
J. Nick Koston 2023-04-05 14:53:19 -10:00 committed by GitHub
parent 397fbc0e41
commit 4c767b2f72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,11 +164,12 @@ async def async_setup_entry( # noqa: C901
obj_type = call.data[CONF_TYPE]
_LOGGER.critical(
"%s objects in memory: %s",
obj_type,
[_safe_repr(obj) for obj in objgraph.by_type(obj_type)],
)
for obj in objgraph.by_type(obj_type):
_LOGGER.critical(
"%s object in memory: %s",
obj_type,
_safe_repr(obj),
)
persistent_notification.create(
hass,