Dl

Dlg – Zero-cost printf-style debugging for Go

Hacker News

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 card

Actual performance

64points
39comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: single · Missing: mac, agents, macos
92%92% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
TrustMRRFits verified-revenue profile · Missing: mobile apps, ios, personal
54%54% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Indie HackersFits the IH revenue-focused audience · Strong signals: created · Missing: supports, reddit linkedin, podcasting
54%54% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: io · Missing: https docs, excited, just released
49%49% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Strong signals: calls · Missing: plus, platform, intuitive
41%41% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
16%16% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

We
We built Mintlify style developer docs with zero cost54%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

We built Mintlify style developer docs with zero cost

Hacker News7
Ze
Zero-Functional 1.0, Zero-Cost Functional Programming in Nim63%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Zero-Functional 1.0, Zero-Cost Functional Programming in Nim

Hacker News1
in
infracost - Cost Estimation for Terraform35%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

infracost - Cost Estimation for Terraform

Hacker News2
Co
Cost of the War in Afghanistan62%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cost of the War in Afghanistan

Hacker News5
Dr
DripStat – Full Java APM at 1/10th the Cost of NewRelic40%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

DripStat – Full Java APM at 1/10th the Cost of NewRelic

Hacker News9
Adtree
Adtree30%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Advertise at no cost. $0 CPM. $0 CPC.

Indie Hackers2advertising
un
unicode.style39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

unicode.style

Hacker News125
Im
Implementing Promise, Functional Style48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Implementing Promise, Functional Style

Hacker News2
Ex
Extensible STL style containers, iterators and algorithms in C52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Extensible STL style containers, iterators and algorithms in C

Hacker News3
Cl
Clerb. ERB-style Clojure templating48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Clerb. ERB-style Clojure templating

Hacker News3