Skip to content

Commit

Permalink
add logging for ui
Browse files Browse the repository at this point in the history
  • Loading branch information
layerssss committed Oct 31, 2018
1 parent 1e0f6ab commit 23bd542
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/localhostd.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class LocalhostD {
Promise.resolve()
.then(() => func())
.catch(error => {
this._debug("error", error.stack);
for (const session of this._sessions) {
session.socket.send(
JSON.stringify({
Expand Down Expand Up @@ -478,6 +479,13 @@ class LocalhostD {
const actionFuncion = this["_doAction" + action.name];
if (!actionFuncion) throw new Error(`${action.name} doesn't exist.`);

this._debug(
"action",
`name: ${action.name}, parameters: ${Object.keys(
action.parameters
).join(" ")}`
);

await actionFuncion.call(this, action.parameters, session);
})
);
Expand Down

0 comments on commit 23bd542

Please sign in to comment.