mirror of
https://github.com/embarklabs/embark.git
synced 2025-02-03 09:24:25 +00:00
fix(embark/logger): fix logs in the dashboard
they were displaying the color as text instead of as a color
This commit is contained in:
parent
cba7c85242
commit
88a41e7c28
@ -1,6 +1,7 @@
|
|||||||
let blessed = require("neo-blessed");
|
let blessed = require("neo-blessed");
|
||||||
const REPL = require('./repl.js');
|
const REPL = require('./repl.js');
|
||||||
const stream = require('stream');
|
const stream = require('stream');
|
||||||
|
const util = require('util');
|
||||||
|
|
||||||
class Monitor {
|
class Monitor {
|
||||||
constructor(_options) {
|
constructor(_options) {
|
||||||
@ -100,7 +101,15 @@ class Monitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
logEntry() {
|
logEntry() {
|
||||||
this.logText.log(...arguments);
|
const args = Array.from(arguments);
|
||||||
|
const color = args[args.length - 1];
|
||||||
|
args.splice(args.length - 1, 1);
|
||||||
|
this.logText.log(...args.filter(arg => arg !== undefined && arg !== null).map(arg => {
|
||||||
|
if (color) {
|
||||||
|
return typeof arg === 'object' ? util.inspect(arg, 2)[color] : arg[color];
|
||||||
|
}
|
||||||
|
return typeof arg === 'object' ? util.inspect(arg, 2) : arg;
|
||||||
|
}));
|
||||||
this.screen.render();
|
this.screen.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user