diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2018-10-24 13:28:30 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2018-11-09 11:35:24 +0000 |
commit | c02115db1de1f3aba81e109043766d600f886522 (patch) | |
tree | 7ee91adba8a9435801ef1ad0f09a3cc92409b3b7 | |
parent | 57d7fae10dbd5a2fd01fdd89c3aeb1024c9a0295 (diff) |
Be more restrictive about which information is included in logging
- Introduce SENSITIVE_DEBUG flag that should be explicitly enabled
in order to have certain information included in logging output.
- Replace qWarning() with qCWarning() where appropriate.
Change-Id: I6386f9cb3ce375101f3c42f407d4af380f1ff75e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
(cherry picked from commit c7a94110987672308ed04b40fd8ed207d1c8d93b)
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
-rw-r--r-- | src/virtualkeyboard/inputcontext.cpp | 6 | ||||
-rw-r--r-- | src/virtualkeyboard/virtualkeyboarddebug.h | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/virtualkeyboard/inputcontext.cpp b/src/virtualkeyboard/inputcontext.cpp index afb6774e..2b11e580 100644 --- a/src/virtualkeyboard/inputcontext.cpp +++ b/src/virtualkeyboard/inputcontext.cpp @@ -419,7 +419,11 @@ void InputContext::sendKeyClick(int key, const QString &text, int modifiers) if (d->focus && d->inputContext) { QKeyEvent pressEvent(QEvent::KeyPress, key, Qt::KeyboardModifiers(modifiers), text); QKeyEvent releaseEvent(QEvent::KeyRelease, key, Qt::KeyboardModifiers(modifiers), text); - VIRTUALKEYBOARD_DEBUG() << "InputContext::::sendKeyClick():" << key; + VIRTUALKEYBOARD_DEBUG().nospace() << "InputContext::sendKeyClick()" +#ifdef SENSITIVE_DEBUG + << ": " << key +#endif + ; d->stateFlags |= InputContextPrivate::KeyEventState; d->inputContext->sendKeyEvent(&pressEvent); diff --git a/src/virtualkeyboard/virtualkeyboarddebug.h b/src/virtualkeyboard/virtualkeyboarddebug.h index d12c029f..49c3e932 100644 --- a/src/virtualkeyboard/virtualkeyboarddebug.h +++ b/src/virtualkeyboard/virtualkeyboarddebug.h @@ -24,6 +24,10 @@ #include <QDebug> +// Enables logging of sensitive information, such as key events. +// Should never be enabled by default. +//#define SENSITIVE_DEBUG + //#define QT_VIRTUALKEYBOARD_DEBUG #ifdef QT_VIRTUALKEYBOARD_DEBUG # define VIRTUALKEYBOARD_DEBUG qDebug |