From 006bbebe60b7f5015d80ac825622cefbc25cd959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Kruni=C4=87?= Date: Mon, 26 Oct 2020 14:55:56 +0100 Subject: [PATCH] feat: log registration and removal of plugins Closes #71 --- src/routes/plugin-register-route.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/routes/plugin-register-route.ts b/src/routes/plugin-register-route.ts index 199e4bc7..ff3c6d71 100644 --- a/src/routes/plugin-register-route.ts +++ b/src/routes/plugin-register-route.ts @@ -21,6 +21,7 @@ import { SCPluginRegisterResponse, SCPluginRegisterRoute, } from '@openstapps/core'; +import {Logger} from '@openstapps/logger'; import {deepStrictEqual} from 'assert'; import {isTestEnvironment, plugins} from '../common'; import {createRoute} from './route'; @@ -75,6 +76,7 @@ function addPlugin(plugin: SCPluginMetaData): SCPluginRegisterResponse { } // it's a new plugin so it can be added to the map of plugins plugins.set(plugin.route, plugin); + Logger.log(`Registered plugin (name: ${plugin.name}, address: ${plugin.address}) on the route "${plugin.route}".`); return {success: true}; } @@ -92,6 +94,7 @@ function removePlugin(route: string): SCPluginRegisterResponse { } // remove the plugin information using its route as a key plugins.delete(route); + Logger.log(`Removed plugin that used the route "${route}".`); return {success: true}; }