From 3c9e4b66793620214036da33dc004814db37b3db Mon Sep 17 00:00:00 2001 From: ced <> Date: Mon, 16 Apr 2007 11:40:07 +0000 Subject: [PATCH] BASE: add logger for print instance workflow bzr revid: ced-267a6d7516e78c8e64be1a370bbf00a452e8b610 --- bin/addons/base/ir/workflow/print_instance.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/addons/base/ir/workflow/print_instance.py b/bin/addons/base/ir/workflow/print_instance.py index 58f719f804c..7e6c78aa10b 100644 --- a/bin/addons/base/ir/workflow/print_instance.py +++ b/bin/addons/base/ir/workflow/print_instance.py @@ -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