Dlg – Zero-cost printf-style debugging for Go
Dlg – Zero-cost printf-style debugging for Go
Hey HN, I tend to use printf-style debugging as my primary troubleshooting method and only resort to gdb as a last resort. While I like its ease of use printf debugging isn't without its annoyances, namely removing the print statements once you're done. I used to use trace-level logging from proper logging libraries but adding trace calls in every corner quickly gets out of control and results in an overwhelming amount of output. To scratch my own itch I created dlg - a minimal debugging library that disappears completely from production builds. Its API exposes just a single function, Printf [1]. dlg is optimized for performance in debug builds and, most importantly, when compiled without the dlg build tag, all calls are eliminated by the Go linker as if dlg was never imported. For debug builds it adds optional stack trace generation configurable via environment variables or linker flags. GitHub: https://github.com/vvvvv/dlg Any feedback is much appreciated. [1]: Actually two functions - there's also SetOutput.
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Incorrect prediction on native model
Similar products
We built Mintlify style developer docs with zero cost
Zero-Functional 1.0, Zero-Cost Functional Programming in Nim
infracost - Cost Estimation for Terraform
Cost of the War in Afghanistan
DripStat – Full Java APM at 1/10th the Cost of NewRelic
Advertise at no cost. $0 CPM. $0 CPC.
unicode.style
Implementing Promise, Functional Style
Extensible STL style containers, iterators and algorithms in C
Clerb. ERB-style Clojure templating