Show HN: Timberlogs – 适用于 TypeScript 的即插即用型结构化日志记录

3作者: enaboapps6 个月前
大家好,我是 Timberlogs 的开发者!我构建 Timberlogs 是因为我厌倦了在生产环境中用 console.log 调试,也觉得现有的日志解决方案设置起来太麻烦了。 Timberlogs 是一个即插即用的 TypeScript 结构化日志库: ``` npm install timberlogs-client import { createTimberlogs } from "timberlogs-client"; const timber = createTimberlogs({ source: "my-app", environment: "production", apiKey: process.env.TIMBER_API_KEY, }); timber.info("用户已登录", { userId: "123" }); timber.error("支付失败", error); ``` 功能: * 自动批处理和重试 * 自动编辑敏感数据(密码、令牌) * 全文搜索所有日志 * 实时仪表盘 * 流程追踪,关联相关日志 目前处于 Beta 测试阶段,免费使用。欢迎 HN 社区提供反馈。 网站:[https://timberlogs.dev](https://timberlogs.dev) 文档:[https://docs.timberlogs.dev](https://docs.timberlogs.dev) npm:[https://npmjs.com/package/timberlogs-client](https://npmjs.com/package/timberlogs-client) GitHub:[https://github.com/enaboapps/timberlogs-typescript-sdk](https://github.com/enaboapps/timberlogs-typescript-sdk)
查看原文
Hi HN! I built Timberlogs because I was tired of console.log in production and existing logging solutions requiring too much setup.<p>Timberlogs is a drop-in structured logging library for TypeScript:<p><pre><code> npm install timberlogs-client import { createTimberlogs } from &quot;timberlogs-client&quot;; const timber = createTimberlogs({ source: &quot;my-app&quot;, environment: &quot;production&quot;, apiKey: process.env.TIMBER_API_KEY, }); timber.info(&quot;User signed in&quot;, { userId: &quot;123&quot; }); timber.error(&quot;Payment failed&quot;, error); </code></pre> Features: - Auto-batching with retries - Automatic redaction of sensitive data (passwords, tokens) - Full-text search across all your logs - Real-time dashboard - Flow tracking to link related logs<p>It&#x27;s currently in beta and free to use. Would love feedback from the HN community.<p>Site: <a href="https:&#x2F;&#x2F;timberlogs.dev" rel="nofollow">https:&#x2F;&#x2F;timberlogs.dev</a> Docs: <a href="https:&#x2F;&#x2F;docs.timberlogs.dev" rel="nofollow">https:&#x2F;&#x2F;docs.timberlogs.dev</a> npm: <a href="https:&#x2F;&#x2F;npmjs.com&#x2F;package&#x2F;timberlogs-client" rel="nofollow">https:&#x2F;&#x2F;npmjs.com&#x2F;package&#x2F;timberlogs-client</a> GitHub: <a href="https:&#x2F;&#x2F;github.com&#x2F;enaboapps&#x2F;timberlogs-typescript-sdk" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;enaboapps&#x2F;timberlogs-typescript-sdk</a>