1.3.6 • Published 5 years ago

standard-log-console v1.3.6

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

standard-log-console

NPM version NPM downloads

Circle CI Travis CI Codecov Coveralls Status

Console support for standard-log.

This is the default reporter of standard-log.

Installation

In normal use case you don't need to reference this library directly.

standard-log exports the main features from standard-log-console.

yarn add standard-log

If you want to access other features from stand-log-console, you can install it directly:

yarn add standard-log-console

Usage

By default, standard-log will use this reporter by default.

If you want to configure standard-log to use other reporters programatically, you can use the createConsoleLogReporter() to create the reporter for console:

import {
  createConsoleLogReporter,
  config, // by `standard-log`
} from 'standard-log'

config({ reporters: [createConsoleLogReporter(), /* other reporters */] })

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 { createConsoleLogReporter } from 'standard-log'

createConsoleLogReporter({
  formatter: yourFormatter
})

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

import { createCssFormatter } from 'standard-log'

createCssFormatter({ maxColor: 30 })

npm.io

You can also configure the timestamp format:

import { createAnsiFormatter, createCssFormatter } from 'standard-log'

createAnsiFormatter({ timestamp: 'none' })
createAnsiFormatter({ timestamp: 'iso' })
createAnsiFormatter({ timestamp: 'elasped' })

createCssFormatter({ timestamp: 'none' })
createCssFormatter({ timestamp: 'iso' })
createCssFormatter({ timestamp: 'elasped' })

npm.io

1.3.6

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.0

5 years ago

1.2.2

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago