From 671cfe49caad5f4b7f209ee8a596cda8a1c7b4a7 Mon Sep 17 00:00:00 2001
From: ynhhoJ <22500212+ynhhoJ@users.noreply.github.com>
Date: Tue, 14 Jul 2026 05:23:49 +0300
Subject: feat: Add plugins version in logs (#871)

---
 frontend/src/plugin-loader.tsx | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

(limited to 'frontend/src/plugin-loader.tsx')

diff --git a/frontend/src/plugin-loader.tsx b/frontend/src/plugin-loader.tsx
index fd4dc1c0..f0a358ef 100644
--- a/frontend/src/plugin-loader.tsx
+++ b/frontend/src/plugin-loader.tsx
@@ -38,6 +38,7 @@ import { checkForPluginUpdates } from './store';
 import TabsHook from './tabs-hook';
 import Toaster from './toaster';
 import { getVersionInfo } from './updater';
+import { getPluginDisplayName } from './utils/pluginHelpers';
 import { getSetting, setSetting } from './utils/settings';
 import TranslationHelper, { TranslationClass } from './utils/TranslationHelper';
 
@@ -343,7 +344,7 @@ class PluginLoader extends Logger {
 
   public dismountAll() {
     for (const plugin of this.plugins) {
-      this.log(`Dismounting ${plugin.name}`);
+      this.log(`Dismounting ${getPluginDisplayName(plugin.name, plugin.version)}`);
       plugin.onDismount?.();
     }
   }
@@ -403,14 +404,14 @@ class PluginLoader extends Logger {
     timeoutMS?: number,
   ) {
     if (useQueue && this.reloadLock) {
-      this.log('Reload currently in progress, adding to queue', name);
+      this.log(`Reload currently in progress, adding ${getPluginDisplayName(name, version)} to queue`);
       this.pluginReloadQueue.push({ name, version: version, loadType });
       return;
     }
 
     try {
       if (useQueue) this.reloadLock = true;
-      this.log(`Trying to load ${name}`);
+      this.log(`Trying to load ${getPluginDisplayName(name, version)}`);
 
       this.unloadPlugin(name, true);
       const startTime = performance.now();
@@ -420,7 +421,7 @@ class PluginLoader extends Logger {
 
       this.deckyState.setDisabledPlugins(this.deckyState.publicState().disabledPlugins.filter((d) => d.name !== name));
       this.deckyState.setPlugins(this.plugins);
-      this.log(`Loaded ${name} in ${endTime - startTime}ms`);
+      this.log(`Loaded ${getPluginDisplayName(name, version)} in ${endTime - startTime}ms`);
     } catch (e) {
       throw e;
     } finally {
@@ -502,16 +503,17 @@ class PluginLoader extends Logger {
               version: version,
               loadType,
             });
-          } else throw new Error(`${name} frontend_bundle not OK`);
+          } else throw new Error(`${getPluginDisplayName(name, version)} frontend_bundle not OK`);
           break;
 
         default:
-          throw new Error(`${name} has no defined loadType.`);
+          throw new Error(`${getPluginDisplayName(name, version)} has no defined loadType.`);
       }
     } catch (e) {
       if (e === timeoutException) throw timeoutException;
 
-      this.error('Error loading plugin ' + name, e);
+      this.error(`Error loading plugin ${getPluginDisplayName(name, version)}`, e);
+
       const TheError: FC<{}> = () => (
         <PanelSection>
           <PanelSectionRow>
@@ -731,7 +733,8 @@ class PluginLoader extends Logger {
           backendAPI.useQuickAccessVisible = useQuickAccessVisible;
         }
 
-        this.debug(`${pluginName} connected to loader API.`);
+        // Note: version info not available at connection time
+        this.debug(`Plugin ${pluginName} connected to loader API.`);
         return backendAPI;
       },
     };
-- 
cgit v1.2.3

