Debugging breaks on launch with bunyan.createLogger - Node v5.8

牧云@^-^@ 提交于 2019-12-11 07:34:31

问题


When I try to launch a node.js app using bunyan, the debugger stops once I try to create the logger. When I step through the code, I can drill into createLogger and find where it breaks. In node_modules/bunyan/lib, the debugger detaches on line 579 -

assert.ok(isWritable(s.stream),
              '"stream" stream is not writable: ' + util.inspect(s.stream));

The debugger works until I set logger, after that it detaches and I can never step to the logger.info line.

import bunyan from 'bunyan'; 

const logger = bunyan.createLogger({ name: 'test' }); //debugger detaches

logger.info('Hello logger'); // debugger will NOT step to this line

This does not happen with winston. I think it has something to do with winston using console and bunyan using streams.

import winston from 'winston';

winston.info('Simple log');

const bp = 'The debugger will stop on me';

回答1:


Had the same issue, but resolved it by updating to the latest version of node(5.9.1)



来源:https://stackoverflow.com/questions/36089897/debugging-breaks-on-launch-with-bunyan-createlogger-node-v5-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!