Skip to main content
This release is 1 version behind 0.8.0 — the latest version of @logtape/logtape. Jump to latest

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 month ago (0.7.1)
interface LogRecord

A log record.

Properties

readonly
category: readonly string[]

The category of the logger that produced the log record.

readonly
level: LogLevel

The log level.

readonly
message: readonly unknown[]

The log message. This is the result of substituting the message template with the values. The number of elements in this array is always odd, with the message template values interleaved between the substitution values.

readonly
rawMessage: string | TemplateStringsArray

The raw log message. This is the original message template without any further processing. It can be either:

  • A string without any substitutions if the log record was created with a method call syntax, e.g., "Hello, {name}!" for logger.info("Hello, {name}!", { name }).
  • A template string array if the log record was created with a tagged template literal syntax, e.g., ["Hello, ", "!"] for ``logger.info`Hello, ${name}!```.

The timestamp of the log record in milliseconds since the Unix epoch.

readonly
properties: Record<string, unknown>

The extra properties of the log record.

Add Package

deno add jsr:@logtape/logtape

Import symbol

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

---- OR ----

Import directly with a jsr specifier

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

Add Package

npx jsr add @logtape/logtape

Import symbol

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

Add Package

yarn dlx jsr add @logtape/logtape

Import symbol

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

Add Package

pnpm dlx jsr add @logtape/logtape

Import symbol

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

Add Package

bunx jsr add @logtape/logtape

Import symbol

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