move setStatus from logger to event bus
This commit is contained in:
parent
66e9d6afa3
commit
445133cfdf
|
@ -80,7 +80,7 @@ class Engine {
|
|||
|
||||
pipelineService(_options) {
|
||||
let self = this;
|
||||
this.logger.setStatus("Building Assets");
|
||||
this.events.emit("status", "Building Assets");
|
||||
let pipeline = new Pipeline({
|
||||
buildDir: this.config.buildDir,
|
||||
contractsFiles: this.config.contractsFiles,
|
||||
|
@ -167,7 +167,7 @@ class Engine {
|
|||
}
|
||||
|
||||
fileWatchService(_options) {
|
||||
this.logger.setStatus("Watching for changes");
|
||||
this.events.emit("status", "Watching for changes");
|
||||
let watch = new Watch({logger: this.logger, events: this.events});
|
||||
watch.start();
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ class Logger {
|
|||
this.logLevels = ['error', 'warn', 'info', 'debug', 'trace'];
|
||||
this.logLevel = options.logLevel || 'info';
|
||||
this.logFunction = options.logFunction || console.log;
|
||||
this.setStatus = options.setStatus || console.log;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,9 +30,9 @@ class Dashboard {
|
|||
function startMonitor(callback) {
|
||||
monitor = new Monitor({env: self.env, console: console});
|
||||
self.logger.logFunction = monitor.logEntry;
|
||||
self.logger.setStatus = monitor.setStatus.bind(monitor);
|
||||
|
||||
self.events.on('contractsState', monitor.setContracts);
|
||||
self.events.on('status', monitor.setStatus.bind(monitor));
|
||||
|
||||
self.logger.info('========================'.bold.green);
|
||||
self.logger.info(('Welcome to Embark ' + self.version).yellow.bold);
|
||||
|
|
|
@ -129,7 +129,7 @@ class Embark {
|
|||
engine.logger.info(err.stack);
|
||||
} else {
|
||||
engine.events.emit('firstDeploymentDone');
|
||||
engine.logger.setStatus("Ready".green);
|
||||
engine.events.emit("status", "Ready".green);
|
||||
engine.logger.info("Looking for documentation? you can find it at ".cyan + "http://embark.readthedocs.io/".green.underline);
|
||||
engine.logger.info("Ready".underline);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class WebServer {
|
|||
this.host = options.host || this.webServerConfig.host;
|
||||
this.port = options.port || this.webServerConfig.port;
|
||||
|
||||
this.logger.setStatus("Starting Server");
|
||||
this.events.emit("status", "Starting Server");
|
||||
this.server = new Server({logger: this.logger, host: this.host, port: this.port});
|
||||
|
||||
this.setServiceCheck();
|
||||
|
|
Loading…
Reference in New Issue