mirror of https://github.com/embarklabs/embark.git
feat(console): print console results as log so cockpit gets it
This commit is contained in:
parent
e3396417da
commit
57cd6d3da1
|
@ -342,7 +342,8 @@ class EmbarkController {
|
|||
new REPL({
|
||||
events: engine.events,
|
||||
env: engine.env,
|
||||
ipc: engine.ipc
|
||||
ipc: engine.ipc,
|
||||
logger: engine.logger
|
||||
}).start(callback);
|
||||
}
|
||||
], function (err, _result) {
|
||||
|
|
|
@ -25,7 +25,7 @@ class Dashboard {
|
|||
start(done) {
|
||||
let monitor;
|
||||
|
||||
monitor = new Monitor({env: this.env, events: this.events, version: this.version, ipc: this.ipc});
|
||||
monitor = new Monitor({env: this.env, events: this.events, version: this.version, ipc: this.ipc, logger: this.logger});
|
||||
this.logger.logFunction = monitor.logEntry;
|
||||
let plugin = this.plugins.createPlugin('dashboard', {});
|
||||
plugin.registerAPICall(
|
||||
|
|
|
@ -11,6 +11,7 @@ class Monitor {
|
|||
this.color = options.color || "green";
|
||||
this.minimal = options.minimal || false;
|
||||
this.ipc = options.ipc;
|
||||
this.logger = options.logger;
|
||||
|
||||
this.screen = blessed.screen({
|
||||
smartCSR: true,
|
||||
|
@ -52,6 +53,7 @@ class Monitor {
|
|||
this.repl = new REPL({
|
||||
events: this.events,
|
||||
env: this.env,
|
||||
logger: this.logger,
|
||||
inputStream: this.terminalReadableStream,
|
||||
outputStream: terminalWritableStream,
|
||||
logText: this.logText,
|
||||
|
|
|
@ -9,6 +9,7 @@ class REPL {
|
|||
this.outputStream = options.outputStream || process.stdout;
|
||||
this.logText = options.logText;
|
||||
this.ipc = options.ipc;
|
||||
this.logger = options.logger;
|
||||
}
|
||||
|
||||
addHistory(cmd) {
|
||||
|
@ -18,9 +19,9 @@ class REPL {
|
|||
}
|
||||
}
|
||||
|
||||
enhancedEval(cmd, context, filename, callback) {
|
||||
this.events.request('console:executeCmd', cmd.trim(), function (err, message) {
|
||||
callback(err, message === undefined ? '' : message); // This way, we don't print undefined
|
||||
enhancedEval(cmd, _context, _filename, _callback) {
|
||||
this.events.request('console:executeCmd', cmd.trim(), (err, message) => {
|
||||
this.logger.info(message === undefined ? '' : message);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue