From 216917b9c3f18217308266565033ce9d1db3c038 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 5 Nov 2020 00:36:19 +0000 Subject: Fallback automatically to a log file if we can detect one, even tho file was never given in the log() call. This might cause some log posts to slip in to the logs, but use suppress=True to force-ignore those in such a case. --- archinstall/lib/output.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'archinstall') diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py index e18a0cd2..8331a04c 100644 --- a/archinstall/lib/output.py +++ b/archinstall/lib/output.py @@ -80,6 +80,9 @@ def log(*args, **kwargs): kwargs = {'bg' : 'black', 'fg': 'white', **kwargs} string = stylize_output(string, **kwargs) + if (logfile := storage.get('logfile', None)) and 'file' not in kwargs: + kwargs['file'] = logfile + # Log to a file output unless specifically told to suppress this feature. # (level has no effect on the log file, everything will be written there) if 'file' in kwargs and ('suppress' not in kwargs or kwargs['suppress'] == False): -- cgit v1.2.3-54-g00ecf