在windows下可以看到类似的记录
D:\DevSpace\StateMachine\app.js:9 [2013-01-09 13:02:24.853] [INFO] console - 2013/0/9 13:2 init config and network stateMachline.start2(); ^ TypeError: Object #<Object> has no method ‘start2’ at Object.<anonymous> (D:\DevSpace\StateMachine\app.js:9:15) at Module._compile (module.js:449:26) at Object.Module._extensions…js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.runMain (module.js:492:10) at process.startup.processNextTick.process._tickCallback (node.js:244:9) linux下怎么用log记录这种崩溃信息
我加上了 但是貌似还是没被捕获到 var stateMachline = require(‘./StateMachine’); var app = stateMachline.createApp(); stateMachline.init(); stateMachline.start();
process.on('uncaughtException’, function (err) { console.log('Caught exception: ' + err); });
依然有报错,崩溃,但是没能打印出ERR消息 2013/0/9 13:30 创建并初始化状态机 [2013-01-09 13:30:46.268] [INFO] console - 2013/0/9 13:30 init config and networ k D:\DevSpace\StateMachine\StateMachine.js:47 cNetwork.conect(); ^ TypeError: Cannot call method ‘conect’ of null at Object.StateMachine.start (D:\DevSpace\StateMachine\StateMachine.js:47:11 ) at Object.<anonymous> (D:\DevSpace\StateMachine\app.js:9:15) at Module._compile (module.js:449:26) at Object.Module._extensions…js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.runMain (module.js:492:10) at process.startup.processNextTick.process._tickCallback (node.js:244:9)
@Catyuki 可以把这些错误信息也捕获到吗??? 我搞了下- -怎么没好用呢…
TypeError: Cannot call method 'conect' of null
at Object.StateMachine.start (D:\DevSpace\StateMachine\StateMachine.js:47:11
)
at Object.<anonymous> (D:\DevSpace\StateMachine\app.js:9:15)
at Module.compile (module.js:449:26)
at Object.Module.extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module.load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process.tickCallback (node.js:244:9)