Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-06-03 10:32:09 +0200
committerGitHub <noreply@github.com>2021-06-03 10:32:09 +0200
commit2731f82d0fd51e87c9c4454a25e1e01f2ae077cf (patch)
tree5e0c16078f135a7e5a80800c751362d065a8d07e
parentf85f99dd401c588fd89cb60cf9dd026444345041 (diff)
parentabcf3ea88a363d0d7055634b28e5b00e1323e6bb (diff)
Merge pull request #539 from archlinux/torxed-improve-logging
Adding --debug and other log enhancements
-rw-r--r--archinstall/__init__.py4
-rw-r--r--archinstall/lib/general.py4
2 files changed, 7 insertions, 1 deletions
diff --git a/archinstall/__init__.py b/archinstall/__init__.py
index fcd9a706..0b799d5b 100644
--- a/archinstall/__init__.py
+++ b/archinstall/__init__.py
@@ -61,6 +61,10 @@ def initialize_arguments():
arguments = initialize_arguments()
+storage['arguments'] = arguments
+if arguments.get('debug'):
+ log(f"Warning: --debug mode will write certain credentials to {storage['LOG_PATH']}/{storage['LOG_FILE']}!", fg="red", level=logging.WARNING)
+
from .lib.plugins import plugins, load_plugin # This initiates the plugin loading ceremony
if arguments.get('plugin', None):
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index 3b62c891..f72311c9 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -13,7 +13,7 @@ from typing import Union
from .exceptions import *
from .output import log
-
+from .storage import storage
def gen_uid(entropy_length=256):
return hashlib.sha512(os.urandom(entropy_length)).hexdigest()
@@ -265,6 +265,8 @@ class SysCommandWorker:
if not self.pid:
try:
os.execve(self.cmd[0], self.cmd, {**os.environ, **self.environment_vars})
+ if storage['arguments'].get('debug'):
+ log(f"Executing: {self.cmd}", level=logging.DEBUG)
except FileNotFoundError:
log(f"{self.cmd[0]} does not exist.", level=logging.ERROR, fg="red")
self.exit_code = 1