ui: Print debug messages only if POTATONV_DEBUG is true

Change-Id: I9bdf20bf1ef599aba2a2250d3a33c2634aa534b0
Signed-off-by: Woomymy <woomy@woomy.be>
This commit is contained in:
Woomymy 2023-11-03 19:36:55 +01:00 committed by Andrey Smirnoff
parent 8c65273bed
commit 513462840a

View file

@ -1,5 +1,9 @@
import chalk
from os import environ
def debug(*data):
if "POTATONV_DEBUG" in environ and bool(environ["POTATONV_DEBUG"]):
print(chalk.yellow("debug"), " ".join(data))
def error(*data, critical=False):
print(chalk.red("error"), " ".join(data))