summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-01-23 12:56:00 +0300
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-02-13 02:12:09 +0100
commita1a15546c2c0df4d0ae202eb3628a522b5cdd133 (patch)
treecb1f5a23534ce80ee0cc76619be52824ff15ad91 /desktop
parentb3d2369fbc3e173e2ce1ed89a87d136da6fe4236 (diff)
Logger should be initialized with local context
... otherwise its output will go to connected soffice, and will not reach the unopkg console, e.g. trying to execute unopkg add wrong_extension_name while an instance of soffice is running. Change-Id: Ic0b0c48f9b3e8be084e0fdd1838cb0614da6817e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87248 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 5fe5c3a3f485f925a327cdc7b95c8691f6078608)
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index e7f7c0c26938..72c5ff315b4b 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -313,13 +313,13 @@ extern "C" int unopkg_main()
// Initialize logging. This will log errors to the console and
// also to file if the --log-file parameter was provided.
- logger.reset(new comphelper::EventLogger(xComponentContext, "unopkg"));
+ logger.reset(new comphelper::EventLogger(xLocalComponentContext, "unopkg"));
const Reference<XLogger> xLogger(logger->getLogger());
xLogger->setLevel(LogLevel::WARNING);
- Reference<XLogFormatter> xLogFormatter(SimpleTextFormatter::create(xComponentContext));
+ Reference<XLogFormatter> xLogFormatter(SimpleTextFormatter::create(xLocalComponentContext));
Sequence < beans::NamedValue > aSeq { { "Formatter", Any(xLogFormatter) } };
- xConsoleHandler.set(ConsoleHandler::createWithSettings(xComponentContext, aSeq));
+ xConsoleHandler.set(ConsoleHandler::createWithSettings(xLocalComponentContext, aSeq));
xLogger->addLogHandler(xConsoleHandler);
xConsoleHandler->setLevel(LogLevel::WARNING);
xLogger->setLevel(LogLevel::WARNING);
@@ -328,7 +328,7 @@ extern "C" int unopkg_main()
if (!logFile.isEmpty())
{
Sequence < beans::NamedValue > aSeq2 { { "Formatter", Any(xLogFormatter) }, {"FileURL", Any(logFile)} };
- xFileHandler.set(css::logging::FileHandler::createWithSettings(xComponentContext, aSeq2));
+ xFileHandler.set(css::logging::FileHandler::createWithSettings(xLocalComponentContext, aSeq2));
xFileHandler->setLevel(LogLevel::WARNING);
xLogger->addLogHandler(xFileHandler);
}