summaryrefslogtreecommitdiff
path: root/python/vyos/airbag.py
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-04-12 21:46:57 +0100
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-04-13 15:53:47 +0100
commit25bf56cb62cc239b28c20512dedd4fa9fa1c8bc5 (patch)
tree3ecbac75abd8c807aaa21d29e3ce95488ce61107 /python/vyos/airbag.py
parent1e6dc1a45dd113dc49d24738d0b324bb67a8d11f (diff)
downloadvyos-1x-25bf56cb62cc239b28c20512dedd4fa9fa1c8bc5.tar.gz
vyos-1x-25bf56cb62cc239b28c20512dedd4fa9fa1c8bc5.zip
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.
Diffstat (limited to 'python/vyos/airbag.py')
-rw-r--r--python/vyos/airbag.py5
1 files changed, 2 insertions, 3 deletions
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()