Bug 451445

Summary: User input shows up in logging output and this can't be disabled.
Product: [Frameworks and Libraries] frameworks-sonnet Reporter: sudden6 <sudden6>
Component: generalAssignee: Martin Sandsmark <martin.sandsmark>
Status: RESOLVED WORKSFORME    
Severity: normal CC: a.samirh78, christoph, faure, kdelibs-bugs-null, nate
Priority: HI    
Version First Reported In: 5.76.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description sudden6 2022-03-13 11:05:27 UTC
SUMMARY

Hi all,

we're are using Sonnet in our Qt based application for spellchecking (https://github.com/qTox/qTox/). qTox uses the global Qt log message handler and Sonnet seems to use this one too. Unfortunately Sonnet seems to log user input in some cases. We are looking for a way to disable this behavior, since qTox is a privacy focused application and we don't want any user input showing up in log files.

STEPS TO REPRODUCE
1. enter "jkl? asdf"  (without "") into a textbox which uses Sonnet for spell checking

Note that the "?" seems to trigger this log message. Unfortunately we're only able to reproduce this on my system, so if you have any hints on what the root cause of this is, they would be highly appreciated.

OBSERVED RESULT

The following log output appears:

:0 : Warning: Unable to find any suggestion for "asdf"

EXPECTED RESULT

Either the user input is censored like:

:0 : Warning: Unable to find any suggestion for "*"

or there is an API function/config option to instantiate Sonnet without logging user input.
I understand that logging user input is crucial for debugging Sonnet, but we should be able to disable this on a per Application or even per input form basis.

SOFTWARE/OS VERSIONS

Operating System: openSUSE Leap 15.3
KDE Plasma Version: 5.18.6
KDE Frameworks Version: 5.76.0
Qt Version: 5.12.7

ADDITIONAL INFORMATION

We're going to workaround this issue by filtering the respective log message, but nevertheless it would be good to fix this properly.
Comment 1 Nate Graham 2022-03-27 17:25:12 UTC
Do you still see this in the 5.92 version? 5.76 is quite old.
Comment 2 Ahmad Samir 2022-03-27 21:20:42 UTC
That log message comes from https://invent.kde.org/frameworks/sonnet/-/blob/master/src/core/guesslanguage.cpp#L613

It's using logging categories, so disabling the kf.sonnet.core logging category, should prevent that output from getting to the log. You can do that using the CLI:
export QT_LOGGING_RULES="*sonnet*=false"  // disables all logging categories for Sonnet

or the kdebugsettings GUI tool.
Comment 3 Bug Janitor Service 2022-04-11 04:34:55 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Bug Janitor Service 2022-04-26 04:35:19 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!