summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configshell/log.py13
-rw-r--r--configshell/shell.py2
2 files changed, 12 insertions, 3 deletions
diff --git a/configshell/log.py b/configshell/log.py
index e932aaa..003d862 100644
--- a/configshell/log.py
+++ b/configshell/log.py
@@ -28,6 +28,7 @@ class Log(object):
Implements a file and console logger using python's logging facility.
Log levels are, in raising criticality:
- debug
+ - verbose
- info
- warning
- error
@@ -36,9 +37,9 @@ class Log(object):
who can then be read/changed by other objects using Prefs()
'''
__borg_state = {}
- levels = ['critical', 'error', 'warning', 'info', 'debug']
+ levels = ['critical', 'error', 'warning', 'info', 'verbose', 'debug']
colors = {'critical': 'red', 'error': 'red', 'warning': 'yellow',
- 'info': 'green', 'debug': 'blue'}
+ 'info': 'green', 'verbose': 'blue', 'debug': 'blue'}
def __init__(self, console_level=None,
logfile=None, file_level=None):
@@ -138,6 +139,14 @@ class Log(object):
trace += '\n%s' % msg
self._log('error', trace)
+ def verbose(self, msg):
+ '''
+ Logs a verbose message.
+ @param msg: The message to log.
+ @type msg: str
+ '''
+ self._log('verbose', msg)
+
def info(self, msg):
'''
Logs an info message.
diff --git a/configshell/shell.py b/configshell/shell.py
index 01adbc8..96c754a 100644
--- a/configshell/shell.py
+++ b/configshell/shell.py
@@ -843,7 +843,7 @@ class ConfigShell(object):
@type cmdline: str
'''
if cmdline:
- self.log.debug("Running command line '%s'." % cmdline)
+ self.log.verbose("Running command line '%s'." % cmdline)
path, command, pparams, kparams = self._parse_cmdline(cmdline)[1:]
self._execute_command(path, command, pparams, kparams)