Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2023-05-15 15:50:11 +0200
committerGitHub <noreply@github.com>2023-05-15 15:50:11 +0200
commitb1f26d94e63a2af77803c364e137faad14b1a67e (patch)
tree66b951c993d58e222f1647f088892966724241aa /archinstall
parent8a292a163ea2e643a8ac5d4cfada8a27076de630 (diff)
Allowing for fg='color' in info, warn, error and debug. (#1818)
* Allowing for fg='color' in info, warn, error and debug. * Converted to a more static definition, mypy does not like magic. * Flake8 fixes
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/output.py46
1 files changed, 36 insertions, 10 deletions
diff --git a/archinstall/lib/output.py b/archinstall/lib/output.py
index bd31b5b3..0395e2e7 100644
--- a/archinstall/lib/output.py
+++ b/archinstall/lib/output.py
@@ -238,20 +238,46 @@ def _stylize_output(
return f'\033[{ansi}m{text}\033[0m'
-def info(*msgs: str):
- log(*msgs, level=logging.INFO)
-
-
-def debug(*msgs: str):
- log(*msgs, level=logging.DEBUG)
+def info(
+ *msgs: str,
+ level: int = logging.INFO,
+ fg: str = 'white',
+ bg: Optional[str] = None,
+ reset: bool = False,
+ font: List[Font] = []
+):
+ log(*msgs, level=level, fg=fg, bg=bg, reset=reset, font=font)
+def debug(
+ *msgs: str,
+ level: int = logging.DEBUG,
+ fg: str = 'white',
+ bg: Optional[str] = None,
+ reset: bool = False,
+ font: List[Font] = []
+):
+ log(*msgs, level=level, fg=fg, bg=bg, reset=reset, font=font)
-def error(*msgs: str):
- log(*msgs, level=logging.ERROR, fg='red')
+def error(
+ *msgs: str,
+ level: int = logging.ERROR,
+ fg: str = 'red',
+ bg: Optional[str] = None,
+ reset: bool = False,
+ font: List[Font] = []
+):
+ log(*msgs, level=level, fg=fg, bg=bg, reset=reset, font=font)
-def warn(*msgs: str):
- log(*msgs, level=logging.WARNING, fg='yellow')
+def warn(
+ *msgs: str,
+ level: int = logging.WARN,
+ fg: str = 'yellow',
+ bg: Optional[str] = None,
+ reset: bool = False,
+ font: List[Font] = []
+):
+ log(*msgs, level=level, fg=fg, bg=bg, reset=reset, font=font)
def log(