X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=lib%2Fmudpy%2Fmisc.py;fp=lib%2Fmudpy%2Fmisc.py;h=8e747dd819ffb300e602fa1989329798b53f84ca;hp=2bec9bf60c233f9c6c7315bd553b496d13f9b41a;hb=bc1722f6f7aa9ccc4aeb28bc091b0bffe7f66433;hpb=825fd8d09dc4c276a496d994b02293de2752f3e3 diff --git a/lib/mudpy/misc.py b/lib/mudpy/misc.py index 2bec9bf..8e747dd 100644 --- a/lib/mudpy/misc.py +++ b/lib/mudpy/misc.py @@ -384,11 +384,15 @@ class Universe: filename = os.path.join(self.startdir, filename) self.filename = filename if load: - self.load() + # make sure to preserve any accumulated log entries during load + self.setup_loglines += self.load() def load(self): """Load universe data from persistent storage.""" + # it's possible for this to enter before logging configuration is read + pending_loglines = [] + # the files dict must exist and filename needs to be read-only if not hasattr( self, "files" @@ -432,6 +436,7 @@ class Universe: for element in self.contents.values(): element.update_location() element.clean_contents() + return pending_loglines def new(self): """Create a new, empty Universe (the Big Bang).""" @@ -2456,6 +2461,11 @@ def setup(): global universe universe = Universe(conffile, True) + # report any loglines which accumulated during setup + for logline in universe.setup_loglines: + log(*logline) + universe.setup_loglines = [] + # log an initial message log("Started mudpy with command line: " + " ".join(sys.argv))