rem: fprintf(stderr, "%s: %s\n", (const char*)app->appName(), aMsg);
add: kdebug(KDEBUG_INFO, 0, msg);
context: static void kmailMsgHandler(QtMsgType aType, const char* aMsg){  QString appName = app->appName();  switch (aType)  {  case QtDebugMsg:    fprintf(stderr, "%s: %s\n", (const char*)app->appName(), aMsg);    break;  case QtWarningMsg:    fprintf(stderr, "%s: %s\n", (const char*)app->appName(), aMsg);    if (strncmp(aMsg,"KCharset:",9) != 0 &&	strncmp(aMsg,"QGManager:",10) != 0)      KMsgBox::message(NULL, appName+" "+nls->translate("warning"), aMsg, 		       KMsgBox::EXCLAMATION);    break;  case QtFatalMsg:    fprintf(stderr, appName+" "+nls->translate("fatal error")+": %s\n", aMsg);    KMsgBox::message(NULL, appName+" "+nls->translate("fatal error"),		     aMsg, KMsgBox::STOP);    abort();  }}