1
0
mirror of https://github.com/nttgin/BGPalerter.git synced 2024-05-19 06:50:08 +00:00

refactoring, introduced dependency injector

This commit is contained in:
Massimo Candela
2019-07-03 01:41:05 +02:00
parent 656ad82003
commit e5ca0e4131
13 changed files with 3277 additions and 3223 deletions

View File

@@ -1,11 +1,11 @@
import logger from '../logger';
export default class Monitor {
constructor(inputManager, name, channel, config, pubSub) {
this.config = config;
this.pubSub = pubSub;
this.input = inputManager;
constructor(name, channel, env) {
this.config = env.config;
this.pubSub = env.pubSub;
this.logger = env.logger;
this.input = env.input;
this.name = name;
this.channel = channel;
this.monitored = [];
@@ -132,8 +132,7 @@ export default class Monitor {
this.pubSub.publish(this.channel, alert);
console.log(alert);
logger.log({
this.logger.log({
level: 'verbose',
message: alert.message
});