Skip to main content

Built and signed on GitHub Actions

Simple logging library with zero dependencies for Deno/Node.js/Bun/browsers

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
3 weeks ago (0.8.0)
method Logger.getChild
Logger.getChild(subcategory:
string
| readonly [string]
| readonly [string, ...string[]]
): Logger

Get a child logger with the given subcategory.

const logger = getLogger("category");
const subLogger = logger.getChild("sub-category");

The above code is equivalent to:

const logger = getLogger("category");
const subLogger = getLogger(["category", "sub-category"]);

Parameters

subcategory:
string
| readonly [string]
| readonly [string, ...string[]]

The subcategory.

Return Type

The child logger.

Add Package

deno add jsr:@logtape/logtape

Import symbol

import { type Logger } from "@logtape/logtape";

---- OR ----

Import directly with a jsr specifier

import { type Logger } from "jsr:@logtape/logtape";

Add Package

npx jsr add @logtape/logtape

Import symbol

import { type Logger } from "@logtape/logtape";

Add Package

yarn dlx jsr add @logtape/logtape

Import symbol

import { type Logger } from "@logtape/logtape";

Add Package

pnpm dlx jsr add @logtape/logtape

Import symbol

import { type Logger } from "@logtape/logtape";

Add Package

bunx jsr add @logtape/logtape

Import symbol

import { type Logger } from "@logtape/logtape";