From 828a09b9c8750dfb582ccd12d79fa7faa4512415 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 24 Jan 2021 22:57:16 +0100 Subject: Simpligied installer.log() to wrap output.log() with it's changes. --- archinstall/lib/output.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'archinstall/lib/output.py') diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py index 267f2635..52b2ce2c 100644 --- a/archinstall/lib/output.py +++ b/archinstall/lib/output.py @@ -37,6 +37,11 @@ class journald(dict): # Fallback logger log_adapter.debug(message) +# TODO: Replace log() for session based logging. +class SessionLogging(): + def __init__(self): + pass + # Found first reference here: https://stackoverflow.com/questions/7445658/how-to-detect-if-the-console-does-support-ansi-escape-codes-in-python # And re-used this: https://github.com/django/django/blob/master/django/core/management/color.py#L12 def supports_color(): @@ -109,6 +114,7 @@ def log(*args, **kwargs): pass # Ignore writing to journald # Finally, print the log unless we skipped it based on level. - # And we print the string which may or may not contain color formatting. + # We use sys.stdout.write()+flush() instead of print() to try and + # fix issue #94 sys.stdout.write(string) sys.stdout.flush() \ No newline at end of file -- cgit v1.2.3-70-g09d2