Skip to main content
This release is a pre-release — the latest non-prerelease version of @logtape/logtape is 0.9.0. Jump to this version

@logtape/logtape@0.10.0-dev.137+92e89de0
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
a week ago (0.10.0-dev.137+92e89de0)
function configureSync
configureSync<
TSinkId extends string,
TFilterId extends string,
>
(config: Config<TSinkId, TFilterId>): void

Configure sync loggers with the specified configuration.

Note that if the given sinks or filters are disposable, they will be disposed when the configuration is reset, or when the process exits.

Also note that passing async sinks or filters will throw. If necessary use resetSync or disposeSync.

Examples

Example 1

configureSync({
  sinks: {
    console: getConsoleSink(),
  },
  loggers: [
    {
      category: "my-app",
      sinks: ["console"],
      level: "info",
    },
    {
      category: "logtape",
      sinks: ["console"],
      level: "error",
    },
  ],
});

Type Parameters

TSinkId extends string
TFilterId extends string

Parameters

The configuration.

Return Type

void

Add Package

deno add jsr:@logtape/logtape

Import symbol

import { configureSync } from "@logtape/logtape";

---- OR ----

Import directly with a jsr specifier

import { configureSync } from "jsr:@logtape/logtape";

Add Package

npx jsr add @logtape/logtape

Import symbol

import { configureSync } from "@logtape/logtape";

Add Package

yarn dlx jsr add @logtape/logtape

Import symbol

import { configureSync } from "@logtape/logtape";

Add Package

pnpm dlx jsr add @logtape/logtape

Import symbol

import { configureSync } from "@logtape/logtape";

Add Package

bunx jsr add @logtape/logtape

Import symbol

import { configureSync } from "@logtape/logtape";