Incorporate pending logs from load during reloads
authorJeremy Stanley <fungi@yuggoth.org>
Fri, 9 Oct 2020 16:42:04 +0000 (16:42 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Fri, 9 Oct 2020 16:42:04 +0000 (16:42 +0000)
The load() method for Universe class objects accumulates potential
log entries because it can be called when logging hasn't been set up
yet (for example, early at service start). When called during a
reload, these messages were previously discarded. Instead, add them
to the loglines attribute of the new universe so they will get
properly logged.

mudpy/misc.py

index 81b43ef..86e4b9d 100644 (file)
@@ -1463,9 +1463,9 @@ def reload_data():
     old_loglines = universe.loglines[:]
     for element in list(universe.contents.values()):
         element.destroy()
-    universe.load()
+    pending_loglines = universe.load()
     new_loglines = universe.loglines[:]
-    universe.loglines = old_loglines + new_loglines
+    universe.loglines = old_loglines + new_loglines + pending_loglines
     for user in old_userlist:
         user.reload()