12.1.2 • Published 11 months ago

standard-log-color v12.1.2

Weekly downloads
179
License
MIT
Repository
github
Last release
11 months ago

standard-log-color

NPM version NPM downloads

Github NodeJS Codecov

Visual Studio Code

standard-log-color provides a log reporter that will color the logger id for standard-log.

This makes the log pops and is easier to spot where the log is coming from.

Install

npm install standard-log-color
yarn add standard-log-color

Usage

import { createStandardLog } from 'standard-log'
import { createColorLogReporter } from 'standard-log-color'

const standardLog = createStandardLog({
   reporters: [createColorLogReporter({ ... })]
})

const log = standardLog.getLogger(...)
log.info('with color!')

Rendering example

By default, it will use ansi formatter in NodeJS and css formatter in browser.

If you want to change that, or use your own formatter:

import { createColorLogReporter } from 'standard-log-color'

createColorLogReporter({
  formatter: yourFormatter
})

For createCssLogFormatter(), you can specify how many colors to use:

import { createCssLogFormatter } from 'standard-log-color'

createCssLogFormatter({ maxColor: 30 })

You can also add timestamp:

import { createAnsiLogFormatter, createCssLogFormatter } from 'standard-log-color'

createAnsiLogFormatter({ timestamp: 'none' })
createAnsiLogFormatter({ timestamp: 'iso' })
createAnsiLogFormatter({ timestamp: 'elapsed' })

createCssLogFormatter({ timestamp: 'none' })
createCssLogFormatter({ timestamp: 'iso' })
createCssLogFormatter({ timestamp: 'elapsed' })
12.1.2

11 months ago

12.0.3

1 year ago

12.0.4

1 year ago

12.0.5

1 year ago

12.0.0

1 year ago

12.0.1

1 year ago

12.0.2

1 year ago

12.1.0

1 year ago

12.1.1

1 year ago

11.5.2

1 year ago

11.4.0

1 year ago

11.2.2

2 years ago

11.4.1

1 year ago

11.2.3

2 years ago

11.2.0

2 years ago

11.2.1

2 years ago

11.5.1

1 year ago

11.5.0

1 year ago

11.3.0

2 years ago

10.0.0

2 years ago

11.0.0

2 years ago

11.0.1

2 years ago

7.0.3

2 years ago

8.0.0

2 years ago

9.0.0

2 years ago

11.1.0

2 years ago

5.0.0

2 years ago

6.0.0

2 years ago

7.0.0

2 years ago

7.0.2

2 years ago

7.0.1

2 years ago

4.0.0

2 years ago

3.2.2

2 years ago

3.2.4

2 years ago

3.2.3

2 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.1

3 years ago

2.3.0

3 years ago

2.2.1

3 years ago

2.1.2

3 years ago

2.2.0

3 years ago

2.2.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.5.25

3 years ago

1.5.24

3 years ago

1.5.23

4 years ago

1.5.22

4 years ago

1.5.21

4 years ago

1.5.20

4 years ago

1.5.19

4 years ago

1.5.17

4 years ago

1.5.16

4 years ago

1.5.15

4 years ago

1.5.14

4 years ago

1.5.13

5 years ago

1.5.12

5 years ago

1.5.11

5 years ago

1.5.10

5 years ago

1.5.9

5 years ago

1.5.8

5 years ago

1.5.7

5 years ago

1.5.6

5 years ago

1.5.5

5 years ago

1.5.4

5 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago