Skip to content

doubco/logbook

Repository files navigation

LogBook 📕

Install

npm install @doubco/log-book --save or yarn add @doubco/log-book

Setup

import { LogBook } from "@doubco/log-book";

export default new LogBook({
  options: {
    colorize: !process.env.NO_COLOR,
    visible: process.env.NODE_ENV == "development" || process.env.SHOW_LOGS,
    browser: process.browser
  },
  hook: (key, ...rest) => {
    // you can use hook to push log to a service.
  }
});

Usage

import log from "./my-logger";

log.info("APP", "Hello World.").

log.error("APP", "Hello World.").

log.warning("APP", "Hello World.").

log.success("APP", "Hello World.").

log.black("APP", "Hello World.").

log.blue("APP", "Hello World.").

log.cyan("APP", "Hello World.").

log.magenta("APP", "Hello World.").

Contribute

Pull requests are welcome and please submit bugs 🐛.

Contact

Releases

No releases published

Packages

No packages published