paulodiovani paulodiovani - 1 year ago 109
Node.js Question

Disable Hapi logs on test environment

I'm using Hapi with Good on a small project and want to disable some logs while testing (

process.env.NODE_ENV == 'test'

This is my

reporters: {
console: [{
module: 'good-console',
}, 'stdout']

And this is the test output:

➜ npm test

Index Route
✓ is ok
160622/214344.247, [response] http://paulodiovani-ideapad:3001: get / {} 200 (27ms)

How can I disable all logs, except

Answer Source

Can you post your good configuration? you probably want something like:

reporters: {
    console: [
        module: 'good-squeeze',
        name: 'Squeeze',
        args: [{error: '*'}]
        module: 'good-console'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download