From 7f56a04919f9f81dd802a8295263f497570e7910 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 23 Feb 2011 03:28:18 +0000 Subject: unified debug output --- (limited to 'TurtleArt/tautils.py') 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: -- cgit v0.9.1