Get the latest tech news
Show HN: Dlg – Zero-cost printf-style debugging for Go
Printf-Style Debugging with Zero-Cost in Production Builds - vvvvv/dlg
When built without the dlg tag, all logging calls disappear entirely from your binary, resulting in no runtime overhead. 🚀 True zero-cost abstraction- Logging calls completely disappear from production binaries ⚡️ Near-zero overhead- Performance-focused design for debug builds 🔍 Smart stack traces- Runtime-configurable stack trace generation 🔒 Concurrent-safe by design- Custom writers simply implement sync.Locker to be safe ✨ Minimalist API- Exposes just two functions, Printf and SetOutput All calls to dlg compile to empty functions Go linker completely eliminates these no-ops Final binary contains no trace of logging code Zero memory overhead, zero CPU impact
Or read this on Hacker News