Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/installer.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-01-24 22:42:07 +0100
committerAnton Hvornum <anton@hvornum.se>2021-01-24 22:42:07 +0100
commitf31d5e34cdfe9594678316dc100d8c381aac1f43 (patch)
treefec12bf14685a10bd271088acbebd04a2d4f8bf8 /archinstall/lib/installer.py
parent97b8bbb7d1e8185aadb73978eb9c447246a799fa (diff)
Trying to centralize the configuration for logging. Phasing out some parameters which also affects the current ability to create multiple log files for multiple runs. This will be re-introduced when logging is made into a class object in a later version
Diffstat (limited to 'archinstall/lib/installer.py')
-rw-r--r--archinstall/lib/installer.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 8c22b51f..025c15cb 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -34,13 +34,19 @@ class Installer():
:type hostname: str, optional
"""
- def __init__(self, partition, boot_partition, *, base_packages='base base-devel linux linux-firmware efibootmgr nano', profile=None, mountpoint='/mnt', hostname='ArchInstalled'):
+ def __init__(self, partition, boot_partition, *, base_packages='base base-devel linux linux-firmware efibootmgr nano', profile=None, mountpoint='/mnt', hostname='ArchInstalled', logdir=None, logfile=None):
self.profile = profile
self.hostname = hostname
self.mountpoint = mountpoint
self.init_time = time.strftime('%Y-%m-%d_%H-%M-%S')
self.milliseconds = int(str(time.time()).split('.')[1])
+
+ if logdir:
+ storage['LOG_PATH'] = logdir
+ if logfile:
+ storage['LOG_FILE'] = logfile
+
self.helper_flags = {
'bootloader' : False,
'base' : False,
@@ -53,7 +59,7 @@ class Installer():
self.partition = partition
self.boot_partition = boot_partition
- def log(self, *args, level=LOG_LEVELS.Debug, file=None, **kwargs):
+ def log(self, *args, level=LOG_LEVELS.Debug, **kwargs):
if not file:
if 'logfile' not in storage:
log_root = os.path.join(os.path.expanduser('~/'), '.cache/archinstall')
@@ -64,7 +70,7 @@ class Installer():
file = storage['logfile']
- log(*args, level=level, file=file, **kwargs)
+ log(*args, level=level, **kwargs)
def __enter__(self, *args, **kwargs):
self.partition.mount(self.mountpoint)