1.0.2 • Published 2 years ago

skog-core v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

skog-core

skog-core are a collection of functions that help you create loggers with context

Getting started

This is the "example implementation" of the Skog interface. If you are implementing a logging library with Skog, it should behave similar to the following example:

import { skogMiddleware, consoleLog as log } from "skog-core";
import express from "express";

function greet(name) {
  log.info(`Hello ${name}`);
}

const app = express();
app.use(skogMiddleware);
app.get("/", (req, res) => {
  log.info("Request received");
  greet(req.query.name);
  res.send(`Hello ${req.query.name}`);
});

app.listen(3000, () => {
  log.info("Starting server");
  greet("world");
});

Full example with comments here.

Explanation

Example using the "low level" API (for making your own implementation) here

References

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago

1.0.0-alpha.0

2 years ago

0.0.0

2 years ago