Skip to content

Commit

Permalink
feat(core-plugins): remove kuzzle-plugin-logger from core plugins and…
Browse files Browse the repository at this point in the history
… mark its config as deprecated
  • Loading branch information
fmauNeko committed Jul 19, 2024
1 parent b35ce72 commit cabb542
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 30 deletions.
1 change: 0 additions & 1 deletion .kuzzlerc.sample.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@
"maxConcurrentPipes": 50,
"pipesBufferSize": 50000,
"include": [
"kuzzle-plugin-logger",
"kuzzle-plugin-auth-passport-local"
]
},
Expand Down
2 changes: 1 addition & 1 deletion lib/config/default.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const defaultConfig: KuzzleConfiguration = {
initTimeout: 10000,
maxConcurrentPipes: 50,
pipesBufferSize: 50000,
include: ["kuzzle-plugin-logger", "kuzzle-plugin-auth-passport-local"],
include: ["kuzzle-plugin-auth-passport-local"],
},
"kuzzle-plugin-logger": {
services: {
Expand Down
5 changes: 1 addition & 4 deletions lib/core/plugin/pluginsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ const strategyError = kerror.wrap("plugin", "strategy");
const controllerError = kerror.wrap("plugin", "controller");

// Without those plugins, Kuzzle won't start at all.
const CORE_PLUGINS = [
"kuzzle-plugin-logger",
"kuzzle-plugin-auth-passport-local",
];
const CORE_PLUGINS = ["kuzzle-plugin-auth-passport-local"];

/**
* @class PluginsManager
Expand Down
15 changes: 4 additions & 11 deletions lib/types/config/PluginsConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export type PluginsConfiguration = {
* Edit this list to deactivate one or more of those plugins.
* NOTE: this list does not control plugins installed manually.
*
* @default ["kuzzle-plugin-logger","kuzzle-plugin-auth-passport-local"]
* @default ["kuzzle-plugin-auth-passport-local"]
*/
include: string[];

Expand Down Expand Up @@ -76,23 +76,16 @@ export type PluginsConfiguration = {
};

/**
* Default logger plugin configuration.
*
* This plugin use Winston to transport the logs.
*
* @see https://github.com/kuzzleio/kuzzle-plugin-logger
* Logger plugin configuration.
* @deprecated use server.logs
*/
"kuzzle-plugin-logger": {
/**
* Winston transport services declaration
* Services declaration
*/
services: {
/**
* Print logs to STDOUT
*
* @default
*
* @see https://github.com/winstonjs/winston/blob/master/docs/transports.md#console-transport
*/
stdout: {
/**
Expand Down
10 changes: 3 additions & 7 deletions test/core/backend/Backend.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ describe("Backend", () => {

should(options.secretsFile).be.eql(application._secretsFile);
should(options.vaultKey).be.eql(application._vaultKey);
should(options.plugins).have.keys(
"kuzzle-plugin-logger",
"kuzzle-plugin-auth-passport-local",
);
should(options.plugins).have.keys("kuzzle-plugin-auth-passport-local");
should(options.installations).be.eql(
application._installationsWaitingList,
);
Expand All @@ -129,7 +126,7 @@ describe("Backend", () => {
);

application.config.content.plugins.common.include = [
"kuzzle-plugin-logger",
"kuzzle-plugin-auth-passport-local",
];

await application.start();
Expand All @@ -138,8 +135,7 @@ describe("Backend", () => {

const [, options] = global.kuzzle.start.getCall(0).args;

should(options.plugins).have.keys("kuzzle-plugin-logger");
should(options.plugins).not.have.keys(
should(options.plugins).have.only.keys(
"kuzzle-plugin-auth-passport-local",
);
});
Expand Down
7 changes: 1 addition & 6 deletions test/core/plugin/pluginsManager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,16 @@ describe("Plugin", () => {
});

it("should only load core plugins in failsafe mode", async () => {
const loggerPlugin = createPlugin("kuzzle-plugin-logger");
const localPlugin = createPlugin("kuzzle-plugin-auth-passport-local");
pluginsManager.loadPlugins.returns(
new Map([
[loggerPlugin.name, loggerPlugin],
[localPlugin.name, localPlugin],
]),
new Map([[localPlugin.name, localPlugin]]),
);
pluginsManager._plugins.set(plugin.name, plugin);
pluginsManager.config.common.failsafeMode = true;

await pluginsManager.init();

should(pluginsManager.loadedPlugins).be.eql([
"kuzzle-plugin-logger",
"kuzzle-plugin-auth-passport-local",
]);
});
Expand Down

0 comments on commit cabb542

Please sign in to comment.