Skip to content

Commit

Permalink
list functions in dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobrosenberg committed Oct 17, 2020
1 parent b364da9 commit 72cc945
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/plugins/debugger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports.default = {
app.log.debug(chalker(`[events] ${event}`))

const name = `${eventCount}.${event.replace(':', '-')}`
const snapshot = JSON.stringify(app, null, 2)
const snapshot = JSON.stringify(app, replacer, 2)
outputFileSync(`${EVENTSFOLDER + name}.json`, snapshot)
const delta = jsondiffpatch.diff(JSON.parse(snapshot), JSON.parse(lastSnapshot))
if (delta) {
Expand Down Expand Up @@ -146,7 +146,7 @@ function getEventStateFromPrevExec(app) {


function logEventHook(app, hook, plugin) {
if(hook.event !== '*'){
if (hook.event !== '*') {
const name = hook.name ? `- ${hook.name}` : ''
const params = chalk.hex(subtle)(JSON.stringify(plugin.params))
app.log.debug(chalker(`[events] ${plugin.name} ${name} ${params}`))
Expand All @@ -171,3 +171,10 @@ function wrapErrorHandler(app) {
errorHandler(err, app)
}
}

function replacer(key, val) {
if (typeof val === 'function') {
return '<function>'
}
return val
}

0 comments on commit 72cc945

Please sign in to comment.