Merge pull request #8 from dondish/master

Added the log function to help TypeScript Users
This commit is contained in:
Wessel T
2019-08-18 18:17:08 +02:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

2
index.d.ts vendored
View File

@@ -14,7 +14,7 @@ declare namespace Pikmin {
public baseFormat: string;
public transports: Pikmin.Transport[];
public [x: string]: function(msg, ...args): void;
public log(type: string, msg: string, ...options): void;
public addTransport(transport: Pikmin.Transport, options?: { autogen: boolean }): void;
}

View File

@@ -54,6 +54,10 @@ module.exports = class PikminInstance {
Pikmin.loggers.set(this.name, this.__log__);
}
log(transportName, msg, ...args) {
this[transportName](msg, ...args)
}
addTransport(transport, options = { autogen: false }) {
const now = this._formatDate();