bunyan-blackhole : Initial commit for v0.2.0 (#14668)

* Initial commit for v0.2.0

* added tslint compliance
This commit is contained in:
Olivier Chevet 2017-03-11 01:15:11 +01:00 committed by Mohamed Hegazy
parent f4e385218b
commit 9af10f325e
4 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,26 @@
import blackhole = require("bunyan-blackhole");
var logsLaboursLost = blackhole("lost");
const rotten = new Error("Something is rotten in the state of Denmark");
logsLaboursLost.info(rotten, "Play %s", "Hamlet");
logsLaboursLost.debug(rotten, "Play %s", "King Lear");
logsLaboursLost.trace(rotten, "Play %s", "Much Ado About Nothing");
logsLaboursLost.warn(rotten, "Play %s", "All's Well That Ends Well");
logsLaboursLost.error(rotten, "Play %s", "Romeo and Juliet");
logsLaboursLost.error("Something is rotten in the state of Denmark");
logsLaboursLost.debug({character: "Marcellus", play: "King Lear"}, "Friends of my soul, you twain");
logsLaboursLost.trace({play: "All's Well That Ends Well"}, "Love all, trust a few, do wrong to none");
logsLaboursLost.info({play: "Much Ado About Nothing"}, "Let me be that I am and seek not to alter me.");
logsLaboursLost.warn({play: "All's Well That Ends Well"}, "Love all, trust a few, do wrong to none");
logsLaboursLost.error({play: "All's Well That Ends Well"}, "Love all, trust a few, do wrong to none");
var hamlet = logsLaboursLost.child({play: "Hamlet"});
hamlet.info({character: "Polonius"}, "Though this be madness, yet there is method in't");

14
bunyan-blackhole/index.d.ts vendored Normal file
View File

@ -0,0 +1,14 @@
// Type definitions for bunyan-blackhole 0.2
// Project: https://github.com/Floby/node-bunyan-blackhole
// Definitions by: Olivier Chevet <https://github.com/olivr70>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as Logger from "bunyan";
/**
* Constructor.
* @param {string} [name] name of the blackhole Logger
* @return {Logger} A bunyan logger .
*/
declare function bunyanBlackHole(name: string): Logger;
export = bunyanBlackHole;

View File

@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"bunyan-blackhole-tests.ts"
]
}

View File

@ -0,0 +1 @@
{ "extends": "../tslint.json" }