0.1.2 • Published 6 years ago

a-better-console v0.1.2

Weekly downloads
17
License
BSD-3-Clause
Repository
github
Last release
6 years ago

better-console

DISCLAIMER: This project is exactly as the good console with one extra feature, passing payloads into the console.

good-console is a transform stream useful for turning good server events into formatted strings.

Build Status Current Version

Lead Maintainer: Martin Arista

Usage

new GoodConsole([config])

Creates a new GoodConsole object with the following arguments:

  • [config] - optional configuration object with the following keys - format - MomentJS format string. Defaults to 'YYMMDD/HHmmss.SSS'. - utc - boolean controlling Moment using utc mode or not. Defaults to true. - color - a boolean specifying whether to output in color. Defaults to true. - requestPayload a boolean specifying if passed request payload will be output to console. Defaults to false. - responsePayload a boolean specifying if passed response payload will be output to console. Defaults to false.

Output Formats

Below are example outputs for the designated event type:

Example

const Logging = {
    register: require('good'),
    options: {
        reporters: {
            console: [{
                module: 'good-squeeze',
                name: 'Squeeze',
                args: [{
                    log: '*',
                    request: '*',
                    error: '*',
                }],
            }, {
                module: 'good-console',
                args: [{
                    responsePayload: true,
                }],
            }, 'stdout'],
        },
        includes: {
            request: ['payload'],
            response: ['payload'],
        },
    },
};
0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.2

7 years ago

0.0.1

7 years ago