I couldn't find a logging library that worked for my library, so I made one

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

Library developers often struggle to balance providing sufficient debugging information with remaining unobtrusive to the end user. Traditional logging frameworks are typically designed for applications, forcing library authors to either impose specific configurations or leave users in the dark when troubleshooting complex protocols like ActivityPub. LogTape provides a solution through a hierarchical category system that ensures zero default output unless explicitly enabled by the application developer. By utilizing these categories, frameworks like Fedify can offer granular visibility into specific subsystems, such as HTTP signature verification or JSON-LD processing, without cluttering the console with internal chatter. Additionally, LogTape leverages implicit contexts and asynchronous local storage to enable seamless request tracing across asynchronous boundaries, allowing developers to correlate related logs through unique identifiers automatically. This approach supports modern runtimes including Node.js, Deno, and Bun, providing a consistent logging experience across diverse environments. By prioritizing an opt-in philosophy and structured data, library authors can provide high-quality observability while maintaining a clean developer experience. Adopting this strategy transforms logging from a potential nuisance into a powerful diagnostic tool for complex distributed systems.

Read more →
5

❤️

5 people reacted.

🐈 cat lover, nix & rust enjoyer

banner is a screenshot from Cyberpunk 2077: Phantom Liberty

여행 기분내며, 여기 저기 낙서하는 https://yearit.com 을 운영 중입니다.

지금까지 다루어 봤던 언어는 아래와 같습니다. MSX Basic Z80 Assembly Pascal GW-Basic C Macromedia Director Visual Basic PHP Flash Actionscript C++ Javascript

그리고 지금은, 하스켈을 비즈니스에 쓰려고 몇 년간 노력하고 있습니다. 지금 상태는, 하스켈 자체를 연구하는 게 아니라, 하스켈 (혹은 함수형 언어) 이해가 어려운 이유를 연구하는 아마추어 연구가쯤 되어버렸습니다. 하스켈 주제로 블로그를 운영 중이지만, 아직은 하스켈 프로그래머라고 자신 있게 말하진 못하고 있습니다. 가끔 이해에 도움이 될만한 측면이 보이면, 가볍게 아이디어를 여러 SNS에 올려보곤 하는데, 그다지 프로그래머에게 쓸모 있는 내용이 포함되진 않는 것 같습니다.

어느 한 개발자입니다.

뭐 짜보려고 해보는 사람입니다.