diff --git a/packages/svrx-util/__tests__/spec/logger.test.js b/packages/svrx-util/__tests__/spec/logger.test.js index 387a6062..6234e0c0 100644 --- a/packages/svrx-util/__tests__/spec/logger.test.js +++ b/packages/svrx-util/__tests__/spec/logger.test.js @@ -89,4 +89,9 @@ describe('logger', () => { }); }); }); + + it('should change category throught #getPluginLogger()', () => { + const pluginLogger = logger.getPluginLogger('test-plugin'); + expect(pluginLogger.category).to.eql('test-plugin'); + }); }); diff --git a/packages/svrx-util/lib/logger.js b/packages/svrx-util/lib/logger.js index 208401af..3bfc13db 100644 --- a/packages/svrx-util/lib/logger.js +++ b/packages/svrx-util/lib/logger.js @@ -135,8 +135,7 @@ LEVELS.forEach((level) => { }); function getPluginLogger(name) { - const categoryName = `plugin-${name}`; - return new Logger(categoryName); + return new Logger(name); } const logger = new Logger();