启动时使用bunyan.createLogger - Node v5.8进行调试 [英] Debugging breaks on launch with bunyan.createLogger - Node v5.8

查看:475
本文介绍了启动时使用bunyan.createLogger - Node v5.8进行调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用bunyan启动一个node.js应用程序时,一旦我尝试创建记录器,调试器停止。当我浏览代码时,我可以深入到createLogger中,找到它所在的位置。在node_modules / bunyan / lib中,调试器在第579行分离 -

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));

调试器可以工作,直到我设置logger,之后它分离,我永远不会走到记录器。信息行。

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

这不会发生在winston。我认为这与winston使用控制台和bunyan使用流有关。

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';


推荐答案

有同样的问题,但是通过更新到节点的最新版本(5.9.1)

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

这篇关于启动时使用bunyan.createLogger - Node v5.8进行调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆