Skip to content

Commit

Permalink
Merge 7a92194 into 63bb849
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychopoulet committed Oct 29, 2020
2 parents 63bb849 + 7a92194 commit 306d2e2
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: node_js
node_js:
- "10"
- "12"
- "14"
install:
Expand Down
2 changes: 1 addition & 1 deletion lib/components/DescriptorUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ module.exports = class DescriptorUser extends Events {
_log (type, message, bold = false) {

if (message && "function" === typeof this._Logger && LOG_TYPES_ALLOWED.includes(type)) {
this._Logger(type, message, bold);
this._Logger(type, message, bold, this.getPluginName());
}

return this;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-pluginsmanager-plugin",
"version": "4.3.0",
"version": "4.3.1",
"description": "An abstract parent plugin for node-pluginsmanager",
"main": "lib/main.js",
"typings": "lib/index.d.ts",
Expand Down
24 changes: 24 additions & 0 deletions test/3_DescriptorUser_4_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,28 @@ describe("DescriptorUser / init", () => {
return new LocalDescriptorUser().init();
});

it("should test logger", (done) => {

new LocalDescriptorUser({
"descriptor": {
"info": {
"title": "test",
"version": "1.7.0",
"description": "This is a test"
}
},
"logger": (type, message, bold, pluginName) => {

strictEqual(type, "error", "logger does not send correct value");
strictEqual(message, "This is a test", "logger does not send correct value");
strictEqual(bold, true, "logger does not send correct value");
strictEqual(pluginName, "test", "logger does not send correct value");

done();

}
})._log("error", "This is a test", true, "test");

});

});
2 changes: 1 addition & 1 deletion test/utils/DescriptorUser/Descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.0.2",
"info": {
"title": "node-pluginsmanager-plugin",
"version": "4.3.0",
"version": "4.3.1",
"description": "An abstract parent plugin for node-pluginsmanager",
"contact": {
"name": "Sébastien VIDAL",
Expand Down

0 comments on commit 306d2e2

Please sign in to comment.