Skip to content

A simple logger that uses chalk. Made for people, not log files

License

Notifications You must be signed in to change notification settings

blacksun1/chalk-logger

Repository files navigation

blacksun1-chalk-logger

Build Status Coverage Status

A pleasant readable logger for humans.

Usage

First install the package into your application

npm install --save blacksun1-chalk-logger

and then in your code

const LoggerFactory = require("blacksun1-chalk-logger").loggerFactory;
const Package = require("./package.json");

const myLogger = LoggerFactory(Package.name);

myLogger.info("I'm logging!");

or if you use Intavenous you can use the registration package to regisiter it and it's required services into your container.

const LoggerModule = require("blacksun1-chalk-logger").registrationModule;
const Package = require("./package.json");
const Intavenous = require("intavenous");

const container = Intavenous.create();
LoggerModule(container);
const myLogger = container.get("logger", Package.name);

myLogger.info("I'm logging!");

API

Exports the following:

  • logger - The actual logger class. Requires constructor arguments.
  • loggerFactory - A factory function to create an instance of the logger class. Takes a parameter of name to set the name of the logger.
  • registrationModule - A registration module. See blacksun1/ioc-test.

About

A simple logger that uses chalk. Made for people, not log files

Resources

License

Stars

Watchers

Forks

Packages

No packages published