summaryrefslogtreecommitdiff
path: root/python/vyos/ifconfig
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/ifconfig
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/ifconfig')
-rw-r--r--python/vyos/ifconfig/control.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/vyos/ifconfig/control.py b/python/vyos/ifconfig/control.py
index 464cd585e..7bb63beed 100644
--- a/python/vyos/ifconfig/control.py
+++ b/python/vyos/ifconfig/control.py
@@ -16,8 +16,9 @@
import os
-from vyos.util import debug, debug_msg
-from vyos.util import popen, cmd
+from vyos import debug
+from vyos.util import popen
+from vyos.util import cmd
from vyos.ifconfig.section import Section
@@ -35,10 +36,10 @@ class Control(Section):
# if debug is not explicitely disabled the the config, enable it
self.debug = ''
if kargs.get('debug', True):
- self.debug = debug('ifconfig')
+ self.debug = debug.enabled('ifconfig')
def _debug_msg (self, message):
- return debug_msg(message, self.debug)
+ return debug.message(message, self.debug)
def _popen(self, command):
return popen(command, self.debug)