core.py: logging output now respects debug values
@@ -185,6 +185,7 @@ class StaSh(object):
command = '$STASH_ROOT/bin/totd.py'
if command:
# do not run command if command is False (but not None)
+ if self.runtime.debug:
self.logger.debug("Running command: {!r}".format(command))
self(command, add_to_history=False, persistent_level=0)
@@ -262,6 +263,7 @@ class StaSh(object):
fp = os.path.join(lib_path, f)
if f.startswith('lib') and f.endswith('.py') and os.path.isfile(fp):
name, _ = os.path.splitext(f)
+ if self.runtime.debug:
self.logger.debug("Attempting to load library '{}'...".format(name))
try:
self.__dict__[name] = pyimp.load_source(name, fp)
@@ -280,10 +282,12 @@ class StaSh(object):
"""
s = '%s%s\n' % (prefix, s)
if error:
+ if self.runtime.debug:
self.logger.error(s)
if self.runtime.colored_errors:
s = self.text_color(s, "red")
else:
+ if self.runtime.debug:
self.logger.info(s)
self.io.write(s)
