@danielfroz/slog@0.3.1Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Simple log library for containerized applications. Creates JSON and sends it to stdout. If you're looking for full log implementation check other projects. This is meant to be simple and efficient / fast.
Introduction
This is a simple log library. It is meant to be used on projects with Docker / containerized applications with Deno or Node.
Nothing special really just a simple log...
So why create another log library? Well I don't need more than what is included... more information just wastes more CPU cycles ... If you need more... use another library.
Usage
This is an example of usage
import { JsonLog } from "@danielfroz/slog"; const log = new JsonLog(); log.info({ msg: `this is a valid log line` });
You may want to add prefix on all log lines from a component... As such use the following
const id = crypto.randomUUID(); const log = new JsonLog({ level: "INFO", init: { handler: "component", id }, }); log.info({ msg: `this is another line` });
Output produced shall include the information passed.
{ "ts": 1764450995937, "level": "INFO", "handler": "component", "id": "4f8deede-cf40-455a-850e-1807f7410486", "msg": "this is another line" }
Add Package
deno add jsr:@danielfroz/slog
Import symbol
import * as slog from "@danielfroz/slog";
Import directly with a jsr specifier
import * as slog from "jsr:@danielfroz/slog";
Add Package
pnpm i jsr:@danielfroz/slog
pnpm dlx jsr add @danielfroz/slog
Import symbol
import * as slog from "@danielfroz/slog";
Add Package
yarn add jsr:@danielfroz/slog
yarn dlx jsr add @danielfroz/slog
Import symbol
import * as slog from "@danielfroz/slog";
Add Package
vlt install jsr:@danielfroz/slog
Import symbol
import * as slog from "@danielfroz/slog";
Add Package
npx jsr add @danielfroz/slog
Import symbol
import * as slog from "@danielfroz/slog";
Add Package
bunx jsr add @danielfroz/slog
Import symbol
import * as slog from "@danielfroz/slog";