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/ifconfig/control.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'python/vyos/ifconfig') 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) -- cgit v1.2.3