mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Only use verbose console if user add -v flag
This commit is contained in:
parent
c434833208
commit
46effe1fe6
@ -19,6 +19,8 @@ except ModuleNotFoundError as ex:
|
|||||||
|
|
||||||
|
|
||||||
class Console:
|
class Console:
|
||||||
|
level = ""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
if "colorama" in sys.modules:
|
if "colorama" in sys.modules:
|
||||||
init()
|
init()
|
||||||
@ -61,8 +63,9 @@ class Console:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def debug(message):
|
def debug(message):
|
||||||
date_time = Console.get_fmt_date_time()
|
if Console.level == "debug":
|
||||||
Console.magenta(f"[+] Crafty: {date_time} - DEBUG:\t{message}")
|
date_time = Console.get_fmt_date_time()
|
||||||
|
Console.magenta(f"[+] Crafty: {date_time} - DEBUG:\t{message}")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def info(message):
|
def info(message):
|
||||||
|
3
main.py
3
main.py
@ -102,6 +102,9 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
setup_logging(debug=args.verbose)
|
setup_logging(debug=args.verbose)
|
||||||
|
|
||||||
|
if args.verbose:
|
||||||
|
Console.level = "debug"
|
||||||
|
|
||||||
# setting up the logger object
|
# setting up the logger object
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
Console.cyan(f"Logging set to: {logger.level}")
|
Console.cyan(f"Logging set to: {logger.level}")
|
||||||
|
Loading…
Reference in New Issue
Block a user