On Wednesday 05 September 2012 03:58:16 Darrell Anderson wrote:
The messages should be toggled by the user as needed. Some examples:
[tdeinit] Got EXEC_NEW....
[tdeinit] PID xxxx terminated.
[tdeinit] Got SETENV....
[tdeinit] xxxx is executable and not a library. Launching with exec.
I'm testing a patch with three of the fprintf messages converted to kdDebug. One fprintf message has me stumped. I would appreciate help converting this message to kdDebug:
fprintf(stderr, "[tdeinit] Got %s '%s' from %s.\n", (request_header.cmd == LAUNCHER_EXEC ? "EXEC" : (request_header.cmd == LAUNCHER_EXT_EXEC ? "EXT_EXEC" : (request_header.cmd == LAUNCHER_EXEC_NEW ? "EXEC_NEW" : (request_header.cmd == LAUNCHER_SHELL ? "SHELL" : "KWRAPPER" )))), name, launcher ? "launcher" : "socket" );
Thanks.
The simplest way:
QString msg; msg.sprintf("[tdeinit] Got %s '%s' from %s.\n", (request_header.cmd == LAUNCHER_EXEC ? "EXEC" : (request_header.cmd == LAUNCHER_EXT_EXEC ? "EXT_EXEC" : (request_header.cmd == LAUNCHER_EXEC_NEW ? "EXEC_NEW" : (request_header.cmd == LAUNCHER_SHELL ? "SHELL" : "KWRAPPER" )))), name, launcher ? "launcher" : "socket" ); kdDebug() << msg;