From 25bf56cb62cc239b28c20512dedd4fa9fa1c8bc5 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Sun, 12 Apr 2020 21:46:57 +0100 Subject: cmd: T2226: improve debugging allow to setup the debugging from environment variables. allow to set the name of the file used for logging change the name of the debug options to be: - developer: enable pdb of raise - log: all logging messages are logged to a file - ifconfig: show on screen action peformed to change intefaces - command: print all the result of command to screen also provide a way to setup the debugging using environment variables. --- python/vyos/airbag.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'python/vyos/airbag.py') diff --git a/python/vyos/airbag.py b/python/vyos/airbag.py index 664974d5f..b0565192d 100644 --- a/python/vyos/airbag.py +++ b/python/vyos/airbag.py @@ -19,10 +19,10 @@ import logging import logging.handlers from datetime import datetime +from vyos import debug from vyos.config import Config from vyos.version import get_version from vyos.util import run -from vyos.util import debug # we allow to disable the extra logging @@ -77,8 +77,7 @@ def bug_report(dtype, value, trace): # reach the end of __main__ and was not intercepted def intercepter(dtype, value, trace): bug_report(dtype, value, trace) - # debug returns either '' or 'developer' if debuging is enabled - if debug('developer'): + if debug.enabled('developer'): import pdb pdb.pm() -- cgit v1.2.3