1.1.0 • Published 9 years ago

steeplejack-bunyan v1.1.0

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

Steeplejack Bunyan

Node.js Version Build Status Dependencies Dev Dependencies License

Bunyan implementation for steeplejack logger

Usage

To use, you will need to create a config dependency in the injector. This is a strategy object so, once you've done the initial configuration, everything is controlled by the Logger object.

The constructor accepts anything that can be sent through to Bunyan's createLogger factory method.

Inside the application, you're dealing with the Steeplejack logger class, so just use as normal.

Example

import {Logger} from "steeplejack/lib/logger";
import {Bunyan} from "steeplejack-bunyan";

/* Name for the injector */
const name = "$logger";

/* Factory function */
function config ($config) {

    /* This accepts anything accepted by the Bunyan.createLogger method */
    let opts = {
        name: "loggerName"
    };

    return new Logger(new Bunyan(opts));

}

/* Define the output for the injector */
export let __config = {
    name,
    config
};
1.1.0

9 years ago

1.0.0

9 years ago

1.0.0-0

9 years ago

0.1.0

10 years ago