ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject incubator-ariatosca git commit: Show tracebacks on console when in debug logging mode
Date Thu, 30 Mar 2017 08:09:12 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-48-aria-cli 2bba961c8 -> 1d153e6c7


Show tracebacks on console when in debug logging mode


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/1d153e6c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/1d153e6c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/1d153e6c

Branch: refs/heads/ARIA-48-aria-cli
Commit: 1d153e6c72d8f0022f81cd2791e62c8439e96c0d
Parents: 2bba961
Author: Avia Efrat <avia@gigaspaces.com>
Authored: Wed Mar 29 19:57:38 2017 +0300
Committer: Avia Efrat <avia@gigaspaces.com>
Committed: Thu Mar 30 11:08:26 2017 +0300

----------------------------------------------------------------------
 aria/cli/cli/aria.py | 4 ++--
 aria/cli/logger.py   | 5 ++++-
 aria/cli/main.py     | 6 +++---
 3 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1d153e6c/aria/cli/cli/aria.py
----------------------------------------------------------------------
diff --git a/aria/cli/cli/aria.py b/aria/cli/cli/aria.py
index b699d05..bec0242 100644
--- a/aria/cli/cli/aria.py
+++ b/aria/cli/cli/aria.py
@@ -122,7 +122,7 @@ def set_verbosity_level(ctx, param, value):
     env.logging.verbosity_level = value
 
 
-def set_cli_except_hook(global_verbosity_level):
+def set_cli_except_hook():
 
     def recommend(possible_solutions):
         logger.info('Possible solutions:')
@@ -130,7 +130,7 @@ def set_cli_except_hook(global_verbosity_level):
             logger.info('  - {0}'.format(solution))
 
     def new_excepthook(tpe, value, tb):
-        if global_verbosity_level:
+        if env.logging.is_high_verbose_level():
             # log error including traceback
             logger.error(get_exception_as_string(tpe, value, tb))
         else:

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1d153e6c/aria/cli/logger.py
----------------------------------------------------------------------
diff --git a/aria/cli/logger.py b/aria/cli/logger.py
index be08860..289dbd3 100644
--- a/aria/cli/logger.py
+++ b/aria/cli/logger.py
@@ -72,10 +72,13 @@ class Logging(object):
     def verbosity_level(self):
         return self._verbosity_level
 
+    def is_high_verbose_level(self):
+        return self.verbosity_level == HIGH_VERBOSE
+
     @verbosity_level.setter
     def verbosity_level(self, level):
         self._verbosity_level = level
-        if self._verbosity_level >= HIGH_VERBOSE:
+        if self.is_high_verbose_level():
             for logger_name in self._all_loggers:
                 logging.getLogger(logger_name).setLevel(logging.DEBUG)
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1d153e6c/aria/cli/main.py
----------------------------------------------------------------------
diff --git a/aria/cli/main.py b/aria/cli/main.py
index aca3340..65db170 100644
--- a/aria/cli/main.py
+++ b/aria/cli/main.py
@@ -32,9 +32,9 @@ from .. import install_aria_extensions
 
 
 @aria.group(name='aria')
-@aria.options.verbose(expose_value=True)
+@aria.options.verbose()
 @aria.options.version
-def _aria(verbose):
+def _aria():
     """ARIA's Command Line Interface
 
     To activate bash-completion. Run: `eval "$(_ARIA_COMPLETE=source aria)"`
@@ -42,7 +42,7 @@ def _aria(verbose):
     ARIA's working directory resides by default in ~/.aria. To change it, set
     the environment variable `ARIA_WORKDIR` to something else (e.g. /tmp/).
     """
-    aria.set_cli_except_hook(verbose)
+    aria.set_cli_except_hook()
 
 
 def _register_commands():


Mime
View raw message