mirror of
https://github.com/Wessel/pikmin.git
synced 2026-07-07 16:33:25 +02:00
Still gotta fix typings, temporary fix
This commit is contained in:
@@ -6,7 +6,7 @@ const PikminError = require('./PikminError');
|
||||
module.exports = class PikminInstance {
|
||||
/**
|
||||
* Create a pikmin instance
|
||||
*
|
||||
*
|
||||
* @param {object} options The options for the instance
|
||||
* @param {string} [options.name='main'] The logger's name
|
||||
* @param {string} [options.format='[%h:%m:%s] %l ->'] The logger's format
|
||||
@@ -42,7 +42,7 @@ module.exports = class PikminInstance {
|
||||
if (transport.name) {
|
||||
this[transport.name] = (msg, options) => this._print(msg, Object.assign(transport.defaults, options), transport.name, transport.format || this.baseFormat);
|
||||
this.__log__[transport.name] = (msg, options) => this._print(msg, Object.assign(transport.defaults, options), transport.name, transport.format || this.baseFormat);
|
||||
} else transport.permanent = true;
|
||||
} else transport.permanent = true;
|
||||
} catch(ex) {
|
||||
throw new PikminError(`Failed to write to transporter:\r\n${ex}`);
|
||||
}
|
||||
@@ -59,19 +59,19 @@ module.exports = class PikminInstance {
|
||||
|
||||
if (type(transport) !== 2) throw new TypeError(`"transports" must be type of object but received type ${typeof transport}`);
|
||||
if (transport.name && this[transport.name]) throw new PikminError(`A transporter\'s name inflicted with an already existing declaration`);
|
||||
|
||||
|
||||
try {
|
||||
if (transport.type === 'FILE' && options.autogen) transport.append(`<PIKMIN_AUTOGEN_LINE<${now.days}/${now.months}/${now.years} ${now.hours}:${now.minutes}:${now.seconds}>>\r\n`);
|
||||
|
||||
|
||||
this.transports.push(transport);
|
||||
if (transport.name) {
|
||||
this[transport.name] = (msg, opt) => this._print(msg, Object.assign(transport.defaults, opt), transport.name, transport.format || this.baseFormat,);
|
||||
this.__log__[transport.name] = (msg, opt) => this._print(msg, Object.assign(transport.defaults, opt), transport.name, transport.format || this.baseFormat);
|
||||
} else transport.permanent = true;
|
||||
} else transport.permanent = true;
|
||||
} catch(ex) {
|
||||
throw new PikminError(`Failed to write to transporter:\r\n${ex}`);
|
||||
}
|
||||
|
||||
|
||||
Pikmin.loggers.set(this.name, this.__log__);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user