i18npool/source/localedata/saxparser.cxx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
New commits: commit 2c9821d391c243ae83a408163f054d7a7a9a1daa Author: Keldin Maldonado (KNM) <kemaldon...@csumb.edu> AuthorDate: Sun Jul 21 21:17:11 2024 -0700 Commit: Hossein <hoss...@libreoffice.org> CommitDate: Thu Aug 22 15:46:36 2024 +0200 tdf#130924 use SAL_INFO/WARN instead of f/printf Change-Id: I60ea17f286fd057e8179a14cd682398f2ccac61c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170829 Reviewed-by: Hossein <hoss...@libreoffice.org> Tested-by: Jenkins diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx index 2c959d0648bf..a5860402ca70 100644 --- a/i18npool/source/localedata/saxparser.cxx +++ b/i18npool/source/localedata/saxparser.cxx @@ -38,6 +38,8 @@ #include <tools/long.hxx> #include <rtl/ref.hxx> +#include <sal/log.hxx> + #include "LocaleNode.hxx" using namespace ::cppu; @@ -102,13 +104,13 @@ static Reference< XInputStream > createStreamFromFile( if (!f) { - fprintf(stderr, "failure opening %s ", pcFile); + SAL_WARN("i18npool", "failure opening " << pcFile); return r; } if (fseek( f , 0 , SEEK_END ) == -1) { - fprintf(stderr, "failure fseeking %s ", pcFile); + SAL_WARN("i18npool", "failure fseeking " << pcFile); fclose(f); return r; } @@ -116,14 +118,14 @@ static Reference< XInputStream > createStreamFromFile( tools::Long nLength = ftell( f ); if (nLength == -1) { - fprintf(stderr, "failure ftelling %s ", pcFile); + SAL_WARN("i18npool", "failure ftelling " << pcFile); fclose(f); return r; } if (fseek( f , 0 , SEEK_SET ) == -1) { - fprintf(stderr, "failure fseeking %s ", pcFile); + SAL_WARN("i18npool", "failure fseeking " << pcFile); fclose(f); return r; } @@ -132,7 +134,7 @@ static Reference< XInputStream > createStreamFromFile( if (fread( seqIn.getArray(), nLength , 1 , f ) == 1) r.set( new OInputStream( seqIn ) ); else - fprintf(stderr, "failure reading %s ", pcFile); + SAL_WARN("i18npool", "failure reading " << pcFile); fclose( f ); return r; } @@ -162,7 +164,7 @@ public: // Error handler virtual void SAL_CALL error(const Any& aSAXParseException) override { ++nError; - printf( "Error ! " ); + SAL_WARN("i18npool", "Error !"); throw SAXException( u"error from error handler"_ustr, Reference < XInterface >() , @@ -171,11 +173,11 @@ public: // Error handler virtual void SAL_CALL fatalError(const Any& /*aSAXParseException*/) override { ++nError; - printf( "Fatal Error ! " ); + SAL_WARN("i18npool", "Fatal Error !"); } virtual void SAL_CALL warning(const Any& /*aSAXParseException*/) override { - printf( "Warning ! " ); + SAL_WARN("i18npool", "Warning !"); } @@ -187,7 +189,7 @@ public: // ExtendedDocumentHandler virtual void SAL_CALL startDocument() override { - printf( "parsing document %s started ", theLocale.c_str()); + SAL_INFO("i18npool", "parsing document " << theLocale.c_str() << " started"); of.writeAsciiString("#include <sal/types.h> "); of.writeAsciiString("#include <rtl/ustring.hxx> "); of.writeAsciiString("extern \"C\" { "); @@ -201,16 +203,16 @@ public: // ExtendedDocumentHandler int err = rootNode->getError(); if (err) { - printf( "Error: in data for %s: %d ", theLocale.c_str(), err); + SAL_WARN("i18npool", "Error: in data for " << theLocale.c_str() << ": " << err); nError += err; } } else { ++nError; - printf( "Error: no data for %s ", theLocale.c_str()); + SAL_INFO("i18npool", "Error: no data for " << theLocale.c_str()); } - printf( "parsing document %s finished ", theLocale.c_str()); + SAL_INFO("i18npool", "parsing document " << theLocale.c_str() << " finished"); of.writeAsciiString("} // extern \"C\" "); of.closeOutput();