Kaydet (Commit) e1b0e497 authored tarafından Bahadır Kandemir's avatar Bahadır Kandemir

Print traceback to error log

üst 52c727a1
2008-11-12 Bahadır Kandemir <bahadir@pardus.org.tr>
* comar: Print Python traceback to logfile.
2008-11-02 Bahadır Kandemir <bahadir@pardus.org.tr>
* comar: PolicyKit exceptions now return related action id.
......@@ -116,6 +116,16 @@ log_exception()
log_error("Python Exception [%s] in (%s,%s,%ld): %s\n", eStr, dbus_message_get_interface(my_proc.bus_msg), dbus_message_get_path(my_proc.bus_msg), lineno, vStr);
PyObject *pFrame, *pCode;
while (pTrace != NULL && pTrace != Py_None) {
pFrame = PyObject_GetAttrString(pTrace, "tb_frame");
pCode = PyObject_GetAttrString(pFrame, "f_code");
log_error(" File %s, line %d, in %s()\n", PyString_AsString(PyObject_GetAttrString(pCode, "co_filename")),
(int) PyInt_AsLong(PyObject_GetAttrString(pTrace, "tb_lineno")),
PyString_AsString(PyObject_GetAttrString(pCode, "co_name")));
pTrace = PyObject_GetAttrString(pTrace, "tb_next");
dbus_reply_error("python", eStr, vStr);
......@@ -590,6 +600,7 @@ dbus_policy_check(const char *sender, const char *interface, const char *method)
PolKitResult polkit_result;
char *action = policy_action(interface, method);
printf("action: %s\n", action);
if (policy_check(sender, action, &polkit_result)) {
log_debug(LOG_PLCY, "PolicyKit: %s.%s = %s\n", interface, method, polkit_result_to_string_representation(polkit_result));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment