【问题标题】:Why does winston.log('doesn't print anything?')为什么winston.log('不打印任何东西?')
【发布时间】:2014-07-03 10:26:18
【问题描述】:

我不知道是不是只有我,但是

var winston = require('winston'); winston.log('这不会打印'); winston.info('但这会。');

只打印第二行。

为什么不打印日志?我只想打印日志,级别为:log

winston.log('log', 'This wont print');

这是不可能的还是我做错了什么?

【问题讨论】:

    标签: winston


    【解决方案1】:
    var winston = require('winston');
    :
    :
    :
    winston.level = 'your log level';
    
    This will set the log level to 'your log level'. (Tested with winston 0.7.3)
    

    更好的使用方式:

    console.log('your log')
    

    【讨论】:

      【解决方案2】:

      好吧,事实证明它不可能的,因为log 不是日志级别,但info 是。

      感谢#node.js 中的@elmigranto 指出。

      【讨论】:

        猜你喜欢
        • 2012-12-30
        • 1970-01-01
        • 2011-05-27
        • 2011-10-27
        • 1970-01-01
        • 2019-02-20
        • 1970-01-01
        • 2013-04-06
        • 2019-05-18
        相关资源
        最近更新 更多