diff options
author | Walter Bender <walter.bender@gmail.com> | 2011-02-23 03:28:18 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2011-02-23 03:28:18 (GMT) |
commit | 7f56a04919f9f81dd802a8295263f497570e7910 (patch) | |
tree | a580214a63f3809f63237ee60dcdf993d7543fb7 /TurtleArt/tautils.py | |
parent | d31acf27b7caa0f1b45bb42eaae27617b7670381 (diff) |
unified debug output
Diffstat (limited to 'TurtleArt/tautils.py')
-rw-r--r-- | TurtleArt/tautils.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py index 521637e..845d792 100644 --- a/TurtleArt/tautils.py +++ b/TurtleArt/tautils.py @@ -48,6 +48,22 @@ import logging _logger = logging.getLogger('turtleart-activity') +def debug_output(message_string, running_sugar=False): + """ unified debugging output """ + if running_sugar: + _logger.debug(message_string) + else: + print(message_string) + + +def error_output(message_string, running_sugar=False): + """ unified debugging output """ + if running_sugar: + _logger.error(message_string) + else: + print(message_string) + + class pythonerror(Exception): def __init__(self, value): @@ -338,7 +354,6 @@ def round_int(num): try: float(num) except TypeError: - _logger.debug("error trying to convert %s to number" % (str(num))) raise pythonerror("#syntaxerror") if int(float(num)) == num: |