Include our newline atomically
Sometimes clashing log entries would print on the same line, likely due to some sort of race condition in Python's print() built-in. Instead, add a newline to our actual message and print without an end character. This ensures atomic printing of our log messages.
This commit is contained in:
parent
6ed4efad33
commit
d2d2a9c617
|
@ -146,7 +146,7 @@ class Logger(object):
|
||||||
if self.config["stdout_logging"]:
|
if self.config["stdout_logging"]:
|
||||||
# Assemble output string
|
# Assemble output string
|
||||||
output = colour + prompt + endc + date + prefix + message
|
output = colour + prompt + endc + date + prefix + message
|
||||||
print(output)
|
print(output + "\n", end="")
|
||||||
|
|
||||||
# Log to file
|
# Log to file
|
||||||
if self.config["file_logging"]:
|
if self.config["file_logging"]:
|
||||||
|
|
Loading…
Reference in New Issue