summaryrefslogtreecommitdiff
path: root/desktop/source/pkgchk/unopkg
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-01-23 12:56:00 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-01-23 12:09:35 +0100
commit5fe5c3a3f485f925a327cdc7b95c8691f6078608 (patch)
tree97ddda80336cd7622563962e0abafb43a173ac10 /desktop/source/pkgchk/unopkg
parent46364cca0ea2308c87bf5cdb291f7c67d79c7d2b (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>
Diffstat (limited to 'desktop/source/pkgchk/unopkg')
-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 1f2429000152..eba9c283f9d5 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -303,13 +303,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);
@@ -318,7 +318,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);
}