snackdriver

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

Usage no npm install needed!

<script type="module">
  import snackdriver from 'https://cdn.skypack.dev/snackdriver';
</script>

README

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