1.0.1 • Published 7 years ago

@fyzu/logger v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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

NameTypeDefaultDescription
name{String}''<unknown>'Log Name (Required)
level{String}'info'Log Level
unique{String}trueLog Uniqueness
timestamp{Boolean}falseLog 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 })
1.0.1

7 years ago

1.0.0

7 years ago