This package has been deprecated

Author message:

this is absorbed into 'standard-log' directly. The coloring capability is moved to 'standard-log-color'

standard-log-console
TypeScript icon, indicating that this package has built-in type declarations

1.3.6 • Public • Published

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 })

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' })

Readme

Keywords

none

Package Sidebar

Install

npm i standard-log-console

Weekly Downloads

73

Version

1.3.6

License

MIT

Unpacked Size

123 kB

Total Files

212

Last publish

Collaborators

  • unional