]> SALOME platform Git repositories - tools/sat.git/blobdiff - src/debug.py
Salome HOME
add sat log on http.server 8765
[tools/sat.git] / src / debug.py
index a7c50e85aade084bc5165d88399d67446349cb95..330fb6df37c33468237c5c49f03f4e04528161b4 100755 (executable)
@@ -56,6 +56,7 @@ import sys
 import traceback
 import pprint as PP
 import inspect
+import src
 
 # Compatibility python 2/3 for unicode
 try:
@@ -71,15 +72,17 @@ except ImportError:
 
 _debug = [False] #support push/pop for temporary activate debug outputs
 
-_user = os.environ['USER']
-# wambeke is christian at home
-_developers = ["christian", "wambeke"] # crouzet, kloss ...
-
 
 def isDeveloper():
-    """if you are a developer, sometimes you want verbose traces etc."""
-    res = _user in _developers
-    return res
+    """
+    if you are a developer, sometimes you want verbose traces unconditionally
+    export SAT_DEVELOPER_MODE=1 before launch sat command to do that
+    """
+    res = os.getenv("SAT_DEVELOPER_MODE", "0")
+    if res in "YES yes 1 Y y".split():
+        return True
+    else:
+        return False
 
 def indent(text, amount=2, ch=' '):
     """indent multi lines message"""
@@ -148,7 +151,7 @@ def format_exception(msg, limit=None, trace=None):
   """
   Format a stack trace and the exception information.
   as traceback.format_exception(), without color
-  with traceback only if (_debug) or (DBG._user in DBG._developers)
+  with traceback only if (_debug) or (DBG.isDeveloper())
   """
   etype, value, tb = sys.exc_info()
   res = msg