snackdriver

    1.1.3 • Public • Published

    snackdriver

    A bite-sized bunyan logger with color, express middleware and a built-in stackdriver stream.

    install:

    npm install --save snackdriver

    example:

    const Logger = require("snackdriver");
    const log = new Logger({
        logName: "test",
        logStreams: [
            { env: "development", stream: "bunyanDebugStream" },
            { env: "development", stream: "stdout" },
            { env: "production", stream: "stackdriver" }
        ],
        logLevel: "info"
    });
     
    log.info("hello world");
    log.warn("oh no world");
    log.error("ruh roh world");

    Koa request logging middleware

    app.use(log.koaMiddleWare());

    express request logging middleware

    app.use(log.expressMiddleWare());

    console output:
    alt text

    And if your NODE_ENV is set to production it logs to stack driver.

    stackdriver output:
    alt text

    Keywords

    Install

    npm i snackdriver

    DownloadsWeekly Downloads

    0

    Version

    1.1.3

    License

    UNLICENSED

    Unpacked Size

    103 kB

    Total Files

    23

    Last publish

    Collaborators

    • smick