diff options
author | Keldin Maldonado (KNM) <kemaldonado@csumb.edu> | 2024-07-21 21:17:11 -0700 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2024-08-22 15:46:36 +0200 |
commit | 2c9821d391c243ae83a408163f054d7a7a9a1daa (patch) | |
tree | ad0bb55338ee8a7b1235d0332cc3238b6708b995 /i18npool | |
parent | 3446419b22a50a9baa5e57aa3939025b4417d843 (diff) |
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 <hossein@libreoffice.org>
Tested-by: Jenkins
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/localedata/saxparser.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
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\n", pcFile); + SAL_WARN("i18npool", "failure opening " << pcFile); return r; } if (fseek( f , 0 , SEEK_END ) == -1) { - fprintf(stderr, "failure fseeking %s\n", 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\n", pcFile); + SAL_WARN("i18npool", "failure ftelling " << pcFile); fclose(f); return r; } if (fseek( f , 0 , SEEK_SET ) == -1) { - fprintf(stderr, "failure fseeking %s\n", 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\n", 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 !\n" ); + 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 !\n" ); + SAL_WARN("i18npool", "Fatal Error !"); } virtual void SAL_CALL warning(const Any& /*aSAXParseException*/) override { - printf( "Warning !\n" ); + SAL_WARN("i18npool", "Warning !"); } @@ -187,7 +189,7 @@ public: // ExtendedDocumentHandler virtual void SAL_CALL startDocument() override { - printf( "parsing document %s started\n", theLocale.c_str()); + SAL_INFO("i18npool", "parsing document " << theLocale.c_str() << " started"); of.writeAsciiString("#include <sal/types.h>\n\n\n"); of.writeAsciiString("#include <rtl/ustring.hxx>\n\n\n"); of.writeAsciiString("extern \"C\" {\n\n"); @@ -201,16 +203,16 @@ public: // ExtendedDocumentHandler int err = rootNode->getError(); if (err) { - printf( "Error: in data for %s: %d\n", 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\n", theLocale.c_str()); + SAL_INFO("i18npool", "Error: no data for " << theLocale.c_str()); } - printf( "parsing document %s finished\n", theLocale.c_str()); + SAL_INFO("i18npool", "parsing document " << theLocale.c_str() << " finished"); of.writeAsciiString("} // extern \"C\"\n\n"); of.closeOutput(); |