From: Daan De Meyer Date: Wed, 15 Feb 2023 15:39:34 +0000 (+0100) Subject: Make warn() output yellow X-Git-Tag: v15~314^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95479e4acf47c0c17059ab388b61e560bb04384c;p=thirdparty%2Fmkosi.git Make warn() output yellow --- diff --git a/mkosi/log.py b/mkosi/log.py index bfecf4614..5e666f830 100644 --- a/mkosi/log.py +++ b/mkosi/log.py @@ -29,6 +29,7 @@ class MkosiPrinter: bold = "\033[0;1;39m" if isatty else "" red = "\033[31;1m" if isatty else "" + yellow = "\033[33;1m" if isatty else "" reset = "\033[0m" if isatty else "" prefix = "‣ " @@ -43,6 +44,10 @@ class MkosiPrinter: def color_error(cls, text: Any) -> str: return f"{cls.red}{text}{cls.reset}" + @classmethod + def color_warning(cls, text: Any) -> str: + return f"{cls.yellow}{text}{cls.reset}" + @classmethod def print_step(cls, text: str) -> None: prefix = cls.prefix + " " * cls.level @@ -61,7 +66,7 @@ class MkosiPrinter: @classmethod def warn(cls, text: str) -> None: - cls._print(f"{cls.prefix}{cls.color_error(text)}\n") + cls._print(f"{cls.prefix}{cls.color_warning(text)}\n") @classmethod @contextlib.contextmanager