2.1.11 • Published 9 years ago

note-log v2.1.11

Weekly downloads
5
License
ISC
Repository
github
Last release
9 years ago

Note

Minimal logging prettifier for Node.js.

Usage

Installation

npm install note-log --save

Syntax

note([handle] [, debugLevel] [, obj1 [, objN]]);

The handle and debug level are omittable, but exposes more than one logged values to being misinterpreted as a handle or debug level.

Configuration

All configuration is optional.

note.config({
    dateFormat: 'YYYY-MM-DD HH:mm:ss',
    dateColor: 'green',
    brackets: ['[', ']'],
    debugLevels: ['INFO', 'WARN', 'ERRO'],
    debugLevelColors: ['cyanBright', 'yellowBright', 'redBright'],
    debugTextColors: [null, 'yellowBright', 'redBright'],
    autoError: 2,
    handleLength: 6,
    handlePadding: '_',
    defaultHandle: 'app',
    handleColor: 'cyan',
    capitalizeHandle: true
});

dateFormat

Please consult the Moment.js documentation for a detailed overview of all format options.

dateColor, debugLevelColors, debugTextColors, handleColor

Please consult the cli-color documentation for a detailed overview of all color options. To apply both a foreground and a background color, use an array specifying both, e.g. ['blue', 'bgYellow']. To remove any default coloring, specify null. debugLevelColors affects the color of the debug level indicator only; debugTextColors applies to logged values.

autoError

Debug level to escalate to when error is detected. false to disable.

handleLength

Length of handle in characters. 0 to inherit from handle.

2.1.11

9 years ago

2.1.10

9 years ago

2.1.9

9 years ago

2.1.8

10 years ago

2.1.7

10 years ago

2.1.6

10 years ago

2.1.5

10 years ago

2.1.4

10 years ago

2.1.3

10 years ago

2.1.2

10 years ago

2.1.1

10 years ago

2.0.0

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago