stackasec
stackasec

Reputation: 65

How to debug and log helper functions in docpad.coffee?

Trying to add new helpers to docpad.coffee I'd like to debug these. Having setup node inspector as outlined in http://docpad.org/docs/debug I expected the console to show logs when used with e.g.

getOutDir: (inPath) ->
    console.log('inPath')

How to set breakpoints to helper methods in docpad.coffee? How to log from docpad.coffee?

Upvotes: 1

Views: 367

Answers (2)

Erv Walter
Erv Walter

Reputation: 13788

The instructions on docpad.org for node-inspector are incorrect (they are being worked on). You can't just run docpad-debug because that runs the globally installed version of docpad which confuses the debugger. Instead run the local copy of docpad-debug from your node-modules folder:

./node_modules/.bin/docpad-debug run

Upvotes: 3

stackasec
stackasec

Reputation: 65

How to log from docpad.coffee?

docpad.log("info", "... your log info here ...")

Other log levels are "warn" and "error".

Upvotes: 1

Related Questions