From 868b05f25b0a80c21b9a44b22b8b5b3dc7bc5d6c Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Wed, 18 Mar 2020 12:26:15 +0100 Subject: [PATCH] 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 --- src/common/vfs.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; }