Yep you need to use qCDebug(...) + define categories see in kf5 I already started to do it.
For example "ecm_qt_declare_logging_category(kopete_LIB_SRCS HEADER libkopete_debug.h IDENTIFIER LIBKOPETE_LOG CATEGORY_NAME org.kde.kopete.libkopete)"
we have a cmake macro for defininig it.
You need to create your own log category.
you need to add your new log category in kopete.categories too.

Regarding logging, I just pushed another review request (https://git.reviewboard.kde.org/r/130161/). I spent more time than what I anticipated (and should have), but I think this one (regarding the history plugin fix) should be accepted independently.

Laurent, Pali, if I commit this as it is, then https://git.reviewboard.kde.org/r/130161/ (which ports all debugging statements to categorized logging) but splitting out https://github.com/paulolieuthier/kopete/commit/6a49f82775f3ebc164085874942a519d575b576e before, would it be acceptable?