瀏覽代碼

HUE-8016 [notebook] Avoid to have function address in error log

Prevent:
ERROR    Error running <function check_status at 0x7f18a251af50>

Instead have :
ERROR    Error running check_status
Romain Rigaux 7 年之前
父節點
當前提交
1cd10d5916
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      desktop/libs/notebook/src/notebook/decorators.py

+ 2 - 2
desktop/libs/notebook/src/notebook/decorators.py

@@ -113,7 +113,7 @@ def api_error_handler(func):
       response['status'] = 2
       response['message'] = e.message
     except QueryError, e:
-      LOG.exception('Error running %s' % func)
+      LOG.exception('Error running %s' % func.__name__)
       response['status'] = 1
       response['message'] = smart_unicode(e)
       if response['message'].index("max_row_size"):
@@ -137,7 +137,7 @@ def api_error_handler(func):
       response['status'] = 1
       response['message'] = message.get('error')
     except Exception, e:
-      LOG.exception('Error running %s' % func)
+      LOG.exception('Error running %s' % func.__name__)
       response['status'] = -1
       response['message'] = smart_unicode(e)
     finally: