rename methods
gitea/mylogger/pipeline/pr-master This commit looks good
Details
gitea/mylogger/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
bd48afa684
commit
b53b03b81c
|
@ -19,9 +19,9 @@ module.exports = class Salix {
|
||||||
this._salixVersion = null;
|
this._salixVersion = null;
|
||||||
this._salixConfig = null;
|
this._salixConfig = null;
|
||||||
}
|
}
|
||||||
fooListener(val) {}
|
emit() {}
|
||||||
registerNewListener(externalListenerFunction) {
|
subscribe(externalListenerFunction) {
|
||||||
this.fooListener = externalListenerFunction;
|
this.emit = externalListenerFunction;
|
||||||
}
|
}
|
||||||
async init(logger) {
|
async init(logger) {
|
||||||
this.conf = logger.conf;
|
this.conf = logger.conf;
|
||||||
|
@ -180,7 +180,7 @@ module.exports = class Salix {
|
||||||
return this._salixVersion;
|
return this._salixVersion;
|
||||||
}
|
}
|
||||||
set salixVersion(newVersion) {
|
set salixVersion(newVersion) {
|
||||||
if(this._salixVersion) this.fooListener(newVersion);
|
if(this._salixVersion && (this._salixVersion!== newVersion)) this.emit(newVersion);
|
||||||
|
|
||||||
this._salixVersion = newVersion;
|
this._salixVersion = newVersion;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ module.exports = class MyLogger {
|
||||||
async start() {
|
async start() {
|
||||||
const conf = (this.conf = loadConfig(__dirname, 'config'));
|
const conf = (this.conf = loadConfig(__dirname, 'config'));
|
||||||
const salix = new Salix();
|
const salix = new Salix();
|
||||||
salix.registerNewListener(() => {
|
salix.subscribe(( ) => {
|
||||||
this.stop();
|
this.stop();
|
||||||
this.start();
|
this.start();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue