한국어 (Korean): LogTape 0.12.0 릴리스 노트
日本語 (Japanese): LogTape 0.12.0 リリースノート
中文(台灣) (Chinese (Taiwan)): LogTape 0.12.0 發布說明
中文(中国) (Chinese (China)): LogTape 0.12.0 发布说明
LogTape is a zero-dependency logging library for JavaScript and TypeScript that provides a simple yet flexible logging system. It supports multiple JavaScript runtimes (Deno, Node.js, Bun, browsers, and edge functions), features hierarchical categories, structured logging, and offers seamless integration for both applications and libraries.
What's New in 0.12.0
Trace Log Level
LogTape now includes a trace severity level, which sits below debug in the verbosity hierarchy. This addition provides finer-grained control over logging output, particularly useful for detailed execution flow tracking during development and debugging.
Added "trace" to the LogLevel union type
Added Logger.trace() method for logging trace-level messages
The complete severity hierarchy is now: trace < debug < info < warning < error < fatal
Enhanced File Sink Performance
File sinks now support configurable buffering, significantly improving write performance for high-volume logging scenarios.
Added bufferSize option (default: 8192 characters) to control write buffering behavior
Added flushInterval option (default: 5000ms) for automatic time-based buffer flushing
Set bufferSize to 0 for immediate writes without buffering
Set flushInterval to 0 to disable time-based flushing
Buffer contents are automatically flushed when the sink is disposed
These options are available for both getFileSink() and getRotatingFileSink() functions.
Syslog Support
The new @logtape/syslog package enables sending log messages to syslog servers using the RFC 5424 format.
Support for both UDP and TCP protocols
All standard RFC 5424 facilities (kern, user, mail, daemon, local0–7, etc.)
Automatic priority calculation based on log levels
Structured data support for log record properties
Cross-runtime compatibility with Deno, Node.js, and Bun
Configurable connection timeouts, custom hostnames, and application names
Logger Method Alias
Added Logger.warning() as an alias for Logger.warn() to ensure consistency with the LogLevel type definition. This change addresses the naming mismatch where the LogLevel union type uses "warning" while the logger method was named warn(), making metaprogramming and dynamic method invocation more straightforward.
Unified Package Releases
Starting with version 0.12.0, all LogTape packages including @logtape/otel, @logtape/sentry, and @logtape/syslog share the same version number and are released together. This ensures compatibility between packages and simplifies version management for users.
Improved Build Infrastructure
LogTape has migrated from dnt to tsdown for npm package bundling. tsdown is a library-focused bundler built on top of Rolldown, a Rust-based bundler that powers the next generation of Vite. Unlike general-purpose bundlers, tsdown is specifically optimized for building TypeScript and JavaScript libraries with minimal configuration. This change brings several benefits:
Elimination of bundler warnings in Webpack, Vite, and other build tools
Improved compatibility with modern JavaScript toolchains
Better tree-shaking support
Cleaner package output
Faster build times through Rust-based performance optimizations
Migration Guide
Updating to Trace Level
If you have code that relies on debug being the lowest severity level, you may need to update your log level configurations:
// Before{ lowestLevel: "debug" } // This was the most verbose setting// After{ lowestLevel: "trace" } // Now includes trace messages
Leveraging Buffer Configuration
To optimize file sink performance in high-throughput scenarios:
getFileSink("app.log", { bufferSize: 16384, // Larger buffer for better performance flushInterval: 10_000 // Flush every 10 seconds})
Installation
LogTape 0.12.0 is available on JSR and npm:
deno add jsr:@logtape/logtape # Denonpm add @logtape/logtape # npmpnpm add @logtape/logtape # pnpmyarn add @logtape/logtape # yarnbun add @logtape/logtape # Bun
For the syslog sink:
deno add jsr:@logtape/syslog # Denonpm add @logtape/syslog # npmpnpm add @logtape/syslog # pnpmyarn add @logtape/syslog # yarnbun add @logtape/syslog # Bun
Acknowledgments
We thank all contributors who helped make this release possible, including those who reported issues, submitted pull requests, and provided feedback.
For the complete list of changes, please refer to the changelog.
Takahe has limited support for this type: See Original Article