mirror of https://github.com/status-im/consul.git
ui: Use runInDebug to add error logging to logger service (#8658)
This commit is contained in:
parent
f06e975395
commit
1732cda1e6
|
@ -1,5 +1,15 @@
|
|||
import Service from '@ember/service';
|
||||
import { runInDebug } from '@ember/debug';
|
||||
|
||||
export default Service.extend({
|
||||
execute: function(obj) {},
|
||||
execute: function(obj) {
|
||||
runInDebug(() => {
|
||||
obj = typeof obj.error !== 'undefined' ? obj.error : obj;
|
||||
if (obj instanceof Error) {
|
||||
console.error(obj); // eslint-disable-line no-console
|
||||
} else {
|
||||
console.log(obj); // eslint-disable-line no-console
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -7,7 +7,7 @@ export default Service.extend({
|
|||
logger: service('logger'),
|
||||
// @xstate/fsm
|
||||
log: function(chart, state) {
|
||||
this.logger.execute(`${chart.id} > ${state.value}`);
|
||||
// this.logger.execute(`${chart.id} > ${state.value}`);
|
||||
},
|
||||
addGuards: function(chart, options) {
|
||||
this.guards(chart).forEach(function([path, name]) {
|
||||
|
|
Loading…
Reference in New Issue