npm install @doubco/log-book --save
or yarn add @doubco/log-book
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.
}
});
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.").
Pull requests are welcome and please submit bugs 🐛.
- Follow @doubco on Twitter
- Follow @doubco on Facebook
- Follow @doubco on Instagram
- Email mailto:[email protected]