Adding logging to symmath, and skipping a test that currently fails due to environment issues
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
# Provides sympy representation.
|
||||
|
||||
import os, sys, string, re
|
||||
import logging
|
||||
import operator
|
||||
import sympy
|
||||
from sympy.printing.latex import LatexPrinter
|
||||
@@ -30,7 +31,9 @@ from lxml import etree
|
||||
import requests
|
||||
from copy import deepcopy
|
||||
|
||||
print "[lib.symmath.formula] Warning: Dark code. Needs review before enabling in prod."
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
log.warning("Dark code. Needs review before enabling in prod.")
|
||||
|
||||
os.environ['PYTHONIOENCODING'] = 'utf-8'
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
import os, sys, string, re
|
||||
import traceback
|
||||
from formula import *
|
||||
import logging
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# check function interface
|
||||
@@ -195,6 +198,7 @@ def symmath_check(expect,ans,dynamath=None,options=None,debug=None):
|
||||
fsym = f.sympy
|
||||
msg += '<p>You entered: %s</p>' % to_latex(f.sympy)
|
||||
except Exception,err:
|
||||
log.exception("Error evaluating expression '%s' as a valid equation" % ans)
|
||||
msg += "<p>Error %s in evaluating your expression '%s' as a valid equation</p>" % (str(err).replace('<','<'),
|
||||
ans)
|
||||
if DEBUG:
|
||||
|
||||
Reference in New Issue
Block a user