LogTape 0.10.0 Released

洪 民憙 (Hong Minhee) @hongminhee@hackers.pub

We're pleased to announce the release of LogTape 0.10.0 today. This version introduces several significant enhancements to improve security, flexibility, and usability.

What is LogTape?

LogTape is a simple, zero-dependency logging library for JavaScript with support for multiple runtimes (Node.js, Deno, Bun, browsers, and edge functions). It features structured logging, hierarchical categories, template literals, and is designed to be used in both applications and libraries.

Key Highlights

New Data Redaction Package

The most notable addition in this release is the new @logtape/redaction package, designed to help protect sensitive information in your logs. This package provides two complementary approaches to redaction:

  • Pattern-based redaction: Uses regular expressions to identify and redact sensitive patterns like credit card numbers, email addresses, and tokens in formatted log output.
  • Field-based redaction: Identifies and redacts sensitive fields by their names in structured log data.

The package includes several built-in patterns for common sensitive data types:

  • Credit card numbers
  • Email addresses
  • JSON Web Tokens (JWTs)
  • U.S. Social Security numbers
  • South Korean resident registration numbers

Both approaches can be used independently or combined for maximum security. Comprehensive documentation for these features is available in the Data redaction section of the manual.

Timestamp Formatting Improvements

Text formatters now support omitting timestamps entirely from formatted messages. The TextFormatterOptions.timestamp option has been extended to include "none" and "disabled" values, giving you more control over log output format.

Lazy File Sink Option

A new FileSinkOptions.lazy option has been added, allowing file sinks to open files only when actually needed, which can improve resource utilization.

Config Error Detection

The configure() and configureSync() functions now check for duplicate logger configurations with the same category and throw a ConfigError when detected. This prevents unintended overriding of logger configurations.

Acknowledgments

We'd like to thank our external contributors who helped make this release possible:

  • Ooker for implementing the ability to omit timestamps from formatted messages (#35)
  • Rickey Ward for adding the lazy file sink option (#38, #39)

We encourage all users to upgrade to this version to take advantage of these improvements. As always, we welcome your feedback and contributions.


For more details on these changes, see the full changelog.

3

No comments

If you have a fediverse account, you can comment on this article from your own instance. Search https://hackers.pub/ap/articles/0196e6ce-c0e7-7337-b482-f6efcabcf0f2 on your instance and reply to it.