Skip to content
Snippets Groups Projects
Commit 4590549f authored by Constantin P.'s avatar Constantin P. 💬
Browse files

Merge branch 'hotfix-log' into 'master'

log fix

See merge request !453
parents b6468582 016adc01
No related branches found
No related tags found
1 merge request!453log fix
......@@ -7,10 +7,6 @@
#include "python-cellframe_common.h"
void _PyErr_logIt(const dap_log_level_t a_level, const char *a_tag, const char *a_msg){
_log_it("\0", 0, a_tag, a_level, "%s", a_msg);
}
char* _PyErr_get_stacktrace(PyObject *a_obj){
if (!a_obj){
return "No stack trace";
......@@ -46,14 +42,9 @@ void python_error_in_log_it(const char *a_tag){
const char *l_str_value = PyBytes_AS_STRING(exect_value_str);
char *l_str = dap_strdup_printf(
"An exception occurred while executing a Python script.\n"
"\t%s\n%s", l_str_value ? l_str_value : "(null)",
trackback ? _PyErr_get_stacktrace(trackback) : "(null)"
);
_PyErr_logIt(L_ERROR, a_tag, l_str);
DAP_DELETE(l_str);
_PyErr_logIt(L_ERROR, a_tag, "An exception occurred while executing a Python script.\n"
"\t%s\n%s", l_str_value ? l_str_value : "(null)",
trackback ? _PyErr_get_stacktrace(trackback) : "(null)");
PyErr_Restore(type, value, trackback);
}
......
......@@ -7,7 +7,7 @@
#include "dap_strfuncs.h"
void python_error_in_log_it(const char *a_tag);
void _PyErr_logIt(const dap_log_level_t a_level, const char *a_tag, const char *a_msg);
#define _PyErr_logIt(a_level, a_tag, ...) _log_it(NULL, 0, a_tag, a_level, ##__VA_ARGS__)
PyObject *python_get_config_item(dap_config_t* a_config, const char *a_section, const char *a_key, PyObject *obj_default);
#define Py_BuildNone Py_BuildValue("")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment