BASE: add logger for print instance workflow

bzr revid: ced-267a6d7516e78c8e64be1a370bbf00a452e8b610
This commit is contained in:
ced 2007-04-16 11:40:07 +00:00
parent 5d5069b294
commit 3c9e4b6679
1 changed files with 6 additions and 3 deletions

View File

@ -113,11 +113,11 @@ def graph_instance_get(cr, graph, inst_id, nested=False):
class report_graph_instance(object):
def __init__(self, cr, uid, ids, data):
logger = netsvc.Logger()
try:
import pydot
except Exception,e:
print 'Import Error for pydot, you will not be able to render workflows'
print 'Consider Installing PyDot or dependencies: http://dkbza.org/pydot.html'
logger.notifyChannel('workflow', netsvc.LOG_WARNING, 'Import Error for pydot, you will not be able to render workflows\nConsider Installing PyDot or dependencies: http://dkbza.org/pydot.html')
raise e
self.done = False
@ -135,7 +135,10 @@ class report_graph_instance(object):
graph.set('rankdir', 'LR')
graph_instance_get(cr, graph, inst_id, data.get('nested', False))
ps_string = graph.create_ps(prog='dot')
except:
except Exception, e:
import traceback, sys
tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
logger.notifyChannel('workflow', netsvc.LOG_ERROR, 'Exception in call: ' + tb_s)
# string is in PS, like the success message would have been
ps_string = '''%PS-Adobe-3.0
/inch {72 mul} def