#LogTape

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Just released @logtape/sentry, a sink for @getsentry! Now you can easily send your logs to .

github.com/dahlia/logtape-sent

LogTape records show up in Sentry.
LogTape records show up in Sentry.
anno189

@[email protected]

Simple logging library with zero dependencies for Deno, Node.js, Bun, browsers, and edge functions https://logtape.org/

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Star History of , , and :

star-history.com/#dahlia/fedif

Star History of Fedify, Hollo, and LogTape.
Star History of Fedify, Hollo, and LogTape.
洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected] · Reply to 洪 民憙 (Hong Minhee)'s post

0.7.0をリリースしました!

新機能の暗黙的コンテキストにより、リクエストID、ユーザーIDなどの文脈情報を、手動で渡すことなくログに自動的に含められるようになりました。

詳しくは記事をご覧ください:

zenn.dev/hongminhee/articles/3

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Just released 0.7.0 with implicit contexts! Now you can automatically include request IDs, user IDs, and more in your logs without passing context manually. Read more about this powerful feature:

dev.to/hongminhee/introducing-

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

v0.6.0, a zero-dependency structured logging library for & , has been released. The main changes include:

• Loggers now can override sinks of their ascendants.
• Placeholders in message templates now forgive leading and trailing spaces.
• Added LogRecord.rawMessage property.
• Built-in text formatters now can be customized.

Available now from JSR and npm:

• JSR: jsr.io/@logtape/[email protected]
• npm: npmjs.com/package/@logtape/log

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Starting with the next version of , the built-in text formatters will be highly customizable.

unstable.logtape.org/manual/fo

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Refactoring 's built-in text formatters… It will provide options for more flexible configuration.

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Oh, the 's GitHub repository has reached 400 stars!

github.com/dahlia/logtape

A screenshot of LogTape's GitHub repository with 400 stars.
A screenshot of LogTape's GitHub repository with 400 stars.
洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Version 0.5.0 of , the zero-dependency library for , .js, , edge functions, and browsers, has been released! The main additions include:

• Contexts
• ANSI color formatter
• Comprehensive docs
• A few API conveniences

LogTape v0.5.0 is available from JSR and npm:

• JSR: jsr.io/@logtape/[email protected]
• npm: npmjs.com/package/@logtape/log

In addition, a new website with documentation has been launched, so please check it out!

logtape.org/

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected] · Reply to 洪 民憙 (Hong Minhee)'s post

got its website now!

logtape.org/

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Working on the website… saves me again.

A preview of the LogTape website powered by VitePress
A preview of the LogTape website powered by VitePress
洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected] · Reply to 洪 民憙 (Hong Minhee)'s post

Okay, all done. You can now use to send logs directly to the collector!

github.com/dahlia/logtape-otel

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

I'm implementing an sink for , but it's more complicated than I thought and has a lot of package dependencies… 🤔

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

QiitaにLogTapeの紹介文を日本語で書いて載せました。翻訳機とAIを多用したため、不自然な日本語があるかもしれませんが、不適切な表現を見つけたらぜひご指摘ください!

qiita.com/hongminhee/items/fff

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Wow, a lot of people starred the repo overnight! It's now over 200 stars, thank you.

The LogTape repository on GitHub with 208 stars.
The LogTape repository on GitHub with 208 stars.
洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

In the next version of , a zero-dependency library for & , contexts will be introduced that allow the same set of properties to be shared across multiple log messages. Thanks to @okikio for collaborating on the design! This feature is available for preview in 0.5.0-dev.60+f819929c.

• JSR: jsr.io/@logtape/[email protected]
• npm: npmjs.com/package/@logtape/log

github.com/dahlia/logtape#cont

const logger = getLogger(["my-app", "my-module"]);
const ctx = logger.with({ userId: 1234, requestId: "abc" });
ctx.info `This log message will have the context (userId & requestId).`;
ctx.warn("Context can be used inside message template: {userId}, {requestId}.");
const logger = getLogger(["my-app", "my-module"]); const ctx = logger.with({ userId: 1234, requestId: "abc" }); ctx.info `This log message will have the context (userId & requestId).`; ctx.warn("Context can be used inside message template: {userId}, {requestId}.");
洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

is a logging library for and . It provides a simple and flexible logging system that is easy to use and easy to extend. The highlights of LogTape are:

• Zero dependencies
• Designed to be used in libraries as well as apps
• Supports virtually every runtime: .js, , , edge functions, and browsers
• Structured logging
• Logger categories (names) are hierarchical
• Dead simple sink (destination) interface

logtape.org/

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Released v0.4.2 of , which is a zero-dependency library for & ! Since this version, it work well on Workers out of box!

• JSR: jsr.io/@logtape/[email protected]
• npm: npmjs.com/package/@logtape/log

Fedify: an ActivityPub server framework's avatar
Fedify: an ActivityPub server framework

@[email protected]

offers robust logging capabilities through integration with LogTape. This feature allows you to easily debug and monitor your Fedify app!

To enable , simply install the @logtape/logtape package and configure it in your app's entry point:

import { configure, getConsoleSink } from "@logtape/logtape";

await configure({
  sinks: { console: getConsoleSink() },
  filters: {},
  loggers: [
    { category: "your-app", sinks: ["console"], level: "debug" },
    { category: "fedify",   sinks: ["console"], level: "info" },
  ],
});

Fedify uses hierarchical categories for fine-grained control over log output. Key categories include ["fedify", "federation", "http"] for HTTP requests/responses and ["fedify", "federation", "inbox"]/["fedify", "federation", "outbox"] for incoming/outgoing activities. (There are more categories.)

With integration, you gain valuable insights into your Fedify app's behavior, making troubleshooting and optimization much more straightforward!

https://fedify.dev/manual/log

洪 民憙 (Hong Minhee) 🤏🏼's avatar
洪 民憙 (Hong Minhee) 🤏🏼

@[email protected]

is a logging library for and . It provides a simple and flexible logging system that is easy to use and easy to extend. The highlights of LogTape are:

• Zero dependencies
• Designed to be used in libraries as well as apps
• Supports virtually every runtime: .js, , , edge functions, and browsers
• Structured logging
• Logger categories (names) are hierarchical
• Dead simple sink (destination) interface

github.com/dahlia/logtape

Screenshot: log messages printed out on the terminal
Screenshot: log messages printed out on the terminal
Screenshot: log messages printed out on web browser's console
Screenshot: log messages printed out on web browser's console
洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@[email protected]

Thanks to @kitsonk, 's bug where it failed to load under .js when incorporated in a project from was fixed! The fix is now available at LogTape 0.4.1.

jsr.io/@logtape/[email protected]