mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Added another handler for daemonized...we're getting pretty close, we just need to actually daemonize :)
This commit is contained in:
parent
eee1f7cee2
commit
69c7c76e3a
11
src/world.py
11
src/world.py
@ -91,6 +91,17 @@ def upkeep(scheduleNext=True):
|
||||
pass
|
||||
if gc.garbage:
|
||||
log.warning('Uncollectable garbage: %s', gc.garbage)
|
||||
if conf.daemonized:
|
||||
# If we're daemonized, sys.stdout has been replaced with a StringIO
|
||||
# object, so let's see if anything's been printed, and if so, let's
|
||||
# log.warning it (things shouldn't be printed, and we're more likely
|
||||
# to get bug reports if we make it a warning).
|
||||
assert not type(sys.stdout) == file, 'Not a StringIO object!'
|
||||
s = sys.stdout.getvalue()
|
||||
if s:
|
||||
log.warning('Printed to stdout after daemonization: %s', s)
|
||||
sys.stdout.reset()
|
||||
sys.stdout.truncate()
|
||||
flushed = conf.supybot.flush() and not starting
|
||||
if flushed:
|
||||
flush()
|
||||
|
Loading…
Reference in New Issue
Block a user