From: Hannah von Reth Date: Wed, 18 Mar 2020 11:26:15 +0000 (+0100) Subject: Improve logging of issues during plugin loading X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~125 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=868b05f25b0a80c21b9a44b22b8b5b3dc7bc5d6c;p=nextcloud-desktop.git Improve logging of issues during plugin loading If the plugin could not be loaded the client calls qFatal Make the loading warnings critical so they get printed before we crash --- diff --git a/src/common/vfs.cpp b/src/common/vfs.cpp index 69c377170..45a00ef8b 100644 --- a/src/common/vfs.cpp +++ b/src/common/vfs.cpp @@ -185,26 +185,26 @@ std::unique_ptr OCC::createVfsFromPlugin(Vfs::Mode mode) auto pluginPath = pluginFileName("vfs", name); if (!isVfsPluginAvailable(mode)) { - qCWarning(lcPlugin) << "Could not load plugin: not existant or bad metadata" << pluginPath; + qCCritical(lcPlugin) << "Could not load plugin: not existant or bad metadata" << pluginPath; return nullptr; } QPluginLoader loader(pluginPath); auto plugin = loader.instance(); if (!plugin) { - qCWarning(lcPlugin) << "Could not load plugin" << pluginPath << loader.errorString(); + qCCritical(lcPlugin) << "Could not load plugin" << pluginPath << loader.errorString(); return nullptr; } auto factory = qobject_cast(plugin); if (!factory) { - qCWarning(lcPlugin) << "Plugin" << pluginPath << "does not implement PluginFactory"; + qCCritical(lcPlugin) << "Plugin" << loader.fileName() << "does not implement PluginFactory"; return nullptr; } auto vfs = std::unique_ptr(qobject_cast(factory->create(nullptr))); if (!vfs) { - qCWarning(lcPlugin) << "Plugin" << pluginPath << "does not create a Vfs instance"; + qCCritical(lcPlugin) << "Plugin" << loader.fileName() << "does not create a Vfs instance"; return nullptr; }