diff options
Diffstat (limited to 'geneticone/helper.py')
-rw-r--r-- | geneticone/helper.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/geneticone/helper.py b/geneticone/helper.py index 4b2a207..a1acf42 100644 --- a/geneticone/helper.py +++ b/geneticone/helper.py @@ -11,6 +11,12 @@ import traceback, textwrap, os.path +DEBUG = True + +def set_debug (d): + global DEBUG + DEBUG = d + def debug(*args, **kwargs): """Prints a debug message including filename and lineno. A variable number of positional arguments are allowed. @@ -22,6 +28,8 @@ def debug(*args, **kwargs): (This function is adapted from Edward Jones as published under: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/279155)""" + if not DEBUG : return + stack = traceback.extract_stack() a, b, c, d = stack[-2] a = os.path.basename(a) |