Code Monkey home page Code Monkey logo

logger's Introduction

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

logger's People

Contributors

doowb avatar fyzu avatar michael-ciniawsky avatar shellscape avatar sokra avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.