From 1334900eae40b63c0d492af7fafce72a9a8e6e33 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Tue, 19 Feb 2019 10:01:22 -0500 Subject: [PATCH] fix: log command in console --- packages/embark/src/lib/modules/console/index.ts | 1 + packages/embark/src/test/console.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/embark/src/lib/modules/console/index.ts b/packages/embark/src/lib/modules/console/index.ts index d1fbe134e..571b7c3fb 100644 --- a/packages/embark/src/lib/modules/console/index.ts +++ b/packages/embark/src/lib/modules/console/index.ts @@ -139,6 +139,7 @@ class Console { } private executeCmd(cmd: string, callback: any) { + this.logger.info("console>", cmd); if (!(cmd.split(" ")[0] === "history" || cmd === __("history"))) { this.saveHistory(cmd); } diff --git a/packages/embark/src/test/console.js b/packages/embark/src/test/console.js index e32ce3337..44cfd56a5 100644 --- a/packages/embark/src/test/console.js +++ b/packages/embark/src/test/console.js @@ -2,13 +2,15 @@ let Console = require('../lib/modules/console/'); let Plugins = require('../lib/core/plugins.js'); let IPC = require('../lib/core/ipc.js'); +let Logger = require('../lib/core/logger.js'); let assert = require('assert'); let version = require('../../package.json').version; describe('embark.Console', function() { let ipc = new IPC({ipcRole: 'none'}); let events = {once: () => {}, setCommandHandler: () => {}, emit: () => {}, on: () => {}, request: () => {}}; - let plugins = new Plugins({plugins: {}, events: events}); + let logger = new Logger({logLevel: 'error'}); + let plugins = new Plugins({plugins: {}, events, logger}); let embarkObject = { registerAPICall: () => {}, events: events, @@ -27,7 +29,7 @@ describe('embark.Console', function() { } } } - let console = new Console(embarkObject, {plugins, version, ipc, events}); + let console = new Console(embarkObject, {plugins, version, ipc, events, logger}); describe('#executeCmd', function() {