we need to manually flush log files

This commit is contained in:
jesopo 2020-02-24 17:21:35 +00:00
parent 22a2bead7f
commit 36fd91f009

View file

@ -26,6 +26,7 @@ class Module(ModuleManager.BaseModule):
return self.data_directory("%s/%s.log" % (server_name, sanitised_name)) return self.data_directory("%s/%s.log" % (server_name, sanitised_name))
def _write_line(self, channel, line): def _write_line(self, channel, line):
channel._log_file.write("%s\n" % line) channel._log_file.write("%s\n" % line)
channel._log_file.flush()
def _write(self, channel, filename, key, line): def _write(self, channel, filename, key, line):
if not hasattr(channel, "_log_file"): if not hasattr(channel, "_log_file"):
channel._log_file = utils.io.open(filename, "a") channel._log_file = utils.io.open(filename, "a")