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)
function getTextFormatter
getTextFormatter(options?: TextFormatterOptions): TextFormatter

Get a text formatter with the specified options. Although it's flexible enough to create a custom formatter, if you want more control, you can create a custom formatter that satisfies the TextFormatter type instead.

For more information on the options, see TextFormatterOptions.

By default, the formatter formats log records as follows:

2023-11-14 22:13:20.000 +00:00 [INF] category·subcategory: Hello, world!

Parameters

optional
options: TextFormatterOptions

The options for the text formatter.

Return Type

The text formatter.

Add Package

deno add jsr:@logtape/logtape

Import symbol

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

---- OR ----

Import directly with a jsr specifier

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

Add Package

npx jsr add @logtape/logtape

Import symbol

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

Add Package

yarn dlx jsr add @logtape/logtape

Import symbol

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

Add Package

pnpm dlx jsr add @logtape/logtape

Import symbol

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

Add Package

bunx jsr add @logtape/logtape

Import symbol

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