1

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?

4

2 回答 2

3

docpad.org 上有关节点检查器的说明不正确(正在处理中)。您不能只运行docpad-debug,因为它会运行全局安装的 docpad 版本,这会使调试器感到困惑。而是从 node-modules 文件夹中运行 docpad-debug 的本地副本:

./node_modules/.bin/docpad-debug run
于 2013-10-10T14:10:45.740 回答
1

如何从 docpad.coffee 登录?

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

其他日志级别是“警告”和“错误”。

于 2013-10-07T16:31:36.410 回答