@fyzu/logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

deps

Install

npm i -D @fyzu/logger

⚠️ We do not recommend installing this module globally

Usage

const createLogger = require('@fyzu/logger')
const logger = createLogger({ name: 'wds' })

logger.info('Server Starting')

Options

Name Type Default Description
name {String} ''<unknown>' Log Name (Required)
level {String} 'info' Log Level
unique {String} true Log Uniqueness
timestamp {Boolean} false Log Timestamps

name

Specifies the name of the log to create. This option is required, and used to differentiate between loggers when webpack-log is used in multiple projects executing in the same process

const logger = createLogger({ name: 'wds' })

level

Specifies the level the logger should use. A logger will not produce output for any log level beneath the specified level. Available levels and order are:

[
  'info',
  'warn',
  'error',
  'trace',
  'debug',
  'silent'
]
const logger = createLogger({ level: 'error' })

logger.error(err)

ℹ️ The level names shown above correspond to the available logging methods, with the notable exception of the silent level

timestamp

If true, instructs the logger to display a timestamp for log output, preceding all other data

const logger = createLogger({ timestamp: true })

Readme

Keywords

none

Package Sidebar

Install

npm i @fyzu/logger

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

7.58 kB

Total Files

7

Last publish

Collaborators

  • dvpetrov