[Libreoffice-bugs] [Bug 130924] New: replace debugging printf calls with SAL_INFO/SAL_WARN

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Tue Feb 25 10:49:01 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=130924

            Bug ID: 130924
           Summary: replace debugging printf calls with SAL_INFO/SAL_WARN
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: michael.stahl at cib.de

git grep "\(\b\|f\)printf"

shows that there about 3100 calls to various printf functions.

A substantial part of these are debugging output from C++ source files;
those should be replaced with SAL_INFO typically.

There is also a substantial part which should *not* be replaced:
* printf calls in shell scripts and Makefiles and AWK and Perl
* C source files
* ancient code in */test and */workben directories
* printf that are not for debugging but printing help messages for the end user
* printf that are not for debugging but producing output from some tool
* printf in external/ and odk/ and onlineupdate/source/libmar/
* printf in sal/ (there are bootstrapping problems here)

To a first approximation, a good heuristic is that a printf should be replaced
if it's inside a #ifdef OSL_DEBUG_LEVEL or #ifdef DBGUTIL or similar.

For an example commit see
https://gerrit.libreoffice.org/plugins/gitiles/core/+/a8e83ce1d86892061603159f5c4460803d077fd5%5E!/

The first argument to SAL_INFO is a "log area", see 
include/sal/log-areas.dox for existing ones; it may be necessary to add new log
areas there.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200225/987ab680/attachment.htm>


More information about the Libreoffice-bugs mailing list