HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
uber-go
zap
Go2016–2026
uber-go / zap

zap

Blazing fast, structured, leveled logging in Go.

11Distinct people
11Mentions
0Explicit recommenders
24.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Blazing fast, structured, leveled logging in Go.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year11 dated mentions

Observed mentions: 2016-05-25 23:17:21 UTC to 2026-07-16 15:44:45 UTC.

012342016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC220
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC211
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC000
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC000
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC404
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC000
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

What Hacker News says

11 sources
> I've said for a long time that composability in software is a bit like playing Tetris: the lines have to clear. I love this analogy, and I find it darkly hilarious that most sibling commenters don't seem to understand. Maybe you need to have worked within a million-line codebase to get it. The only way to "clear the lines" in software is to eject them from the main codebase and into imported libraries with stable, well-documented, well-tested APIs that you very rarely if ever (security vulnerabilities?) need to touch after "stabilizing" them. Great public examples: the Go standard library, https://github.com/spf13/viper , https://github.com/uber-go/zap . Viper and zap combined are more than 20,000 lines of code (according to cloc) that I don't need to read or understand how they work - their lines have been "cleared" and all I need to
Read the rest
know is the abstraction. Half the joy to be found when working within massive codebases is successfully clearing lines.
In The Tower Keeps Rising
That test puts a lot of stuff through `slog.Any`, while the zap version uses more strongly-typed variants, so I'm not sure it's a fair comparison. What it comes down to is that zap special cases things like slice-of-int, slice-of-string, slice-of-timestamp, slog doesn't, and the benchmark includes all those special cases. I question whether your typical log statement includes slices. A more fair benchmark would be just scalar types, and zap & slog optimizations there look pretty similar. https://github.com/uber-go/zap/blob/fd37f1f613a87773fc30f719... https://github.com/uber-go/zap/blob/fd37f1f613a87773fc30f719...
In Structured logging with slog
I think Uber chose a better approach for their Go logging library called Zap [1] logger.Info("failed to fetch URL", // Structured context as strongly typed Field values. zap.String("url", url), zap.Int("attempt", 3), zap.Duration("backoff", time.Second), ) They also have zap.Error(err) which generates the "error" key as a convention. [1] https://github.com/uber-go/zap
In Structured logging with slog
It's nice to have this in the standard library, but it doesn't solve any existing pain points around structured log metadata and contexts. We use zap [0] and store a zap logger on the request context which allows different parts of the request pipeline to log with things like tenantId, traceId, and correlationId automatically appended. But getting a logger off the context is annoying, leads to inconsistent logging practices, and creates a logger dependency throughout most of our Go code. [0] https://github.com/uber-go/zap
In Structured logging with slog
It's a little ironic that this application actually does not run on Windows[1] apparently due a bug in a library[2] unfixed since 2018, which is owned and maintained by a $83B publicly-listed company[3], last updated 14 days ago, but unwilling to fix that little cross-platform bug. [1]: https://github.com/mrusme/superhighway84/issues/13 [2]: https://github.com/uber-go/zap/issues/621 [3]: https://github.com/uber-go
In Superhighway84 – a Usenet-inspired decentralized internet discussion system
There is no real good framework and anybody can write a trie based router in 2 hours: https://vluxe.io/golang-router.html However, Go ecosystem is starting to look interesting library-wise, as long as your project doesn't involve enterprise integration with legacy XML services or SOAP, because Go sucks at mostly anything XML. For templating I use Jet because the standard templating library is too basic for professional use https://github.com/CloudyKit/jet . I don't use ORM, I use https://github.com/Masterminds/squirrel for query building and https://github.com/jmoiron/sqlx which helps deals with row<=>struct conversion. For database migrations, I use https://github.com/rubenv/sql-migrate , but if you need an ORM gorm https://github.com/jinzhu/gorm is OK if you do code first and sqlboiler https://github.com/volatiletech/sqlboiler is OK if
Read the rest
you do database first. For session handling I use scs github.com/alexedwards/scs , for converting form encoded data to go structs I use github.com/gorilla/schema, for logging I use zap https://github.com/uber-go/zap. For managing roles in an app I use either the voter pattern https://symfony.com/doc/current/security/voters.html in simple cases or casbin github.com/casbin/casbin . For background jobs I used https://github.com/gocraft/work and https://github.com/gocelery/gocelery , for caching i just use redis https://github.com/go-redis/redis , for data validation I used https://github.com/asaskevich/govalidator or https://github.com/go-ozzo/ozzo-validation . For sending mails to customers I used https://github.com/go-gomail/gomail If i need html forms, I first describe form elements as a struct then write form helpers in jet templating to display them like that: type LoginForm struct { Login, Password string Form } func (form *LoginForm) validate(r *http.Request) error { r.ParseForm() form.Decoder().Decode(form, r.Form) form.Errors = map[string][]string{} if err := (requiredValidator{}).validate(form.Login); err != nil { form.Errors["Login"] = append(form.Errors["Login"], err.Error()) } if err := (requiredValidator{}).validate(form.Password); err != nil { form.Errors["Password"] = append(form.Errors["Password"], err.Error()) } return form.getErrors() } func (form LoginForm) LoginFormView() LoginFormView { return LoginFormView{Fields: []Field{ {Name: "Login", Label: "Email", Type: "text", Value: form.Login, Required: true, Errors: form.Errors["Login"]}, {Name: "Password", Label: "Password", Type: "password", Value: form.Password, Required: true, Errors: form.Errors["Password"]}, {Type: "submit", Value: "Submit", Required: true}, {Type: "reset", Value: "Reset", Required: true}, }, Method: "POST", Name: "LoginForm"} } Then I can just write an helper in jet to display the the form view: {* tag attributes *} {{ block attributes() }} {{range .}} {{.Key}}="{{.Value}}" {{end}} {{ end }} {* form field *} {{block field()}} <label> {{.Label}} <br/> {{if .Type == "textarea" }} {* textarea *} <textarea name="{{.Name}}" {{ yield attributes() .Attributes }} >{{.Value}}</textarea> {{ else if .Type == "select" }} {* select *} <select name="{{.Name}}" {{yield attributes() .Attributes }}> {{ range .Options }} <option value="{{.Value}}" {{ if .Selected }} selected {{ end }}>{{.Label}}</option> {{ end }} </select> {{ else }} {* basic input *} <input type="{{.Type}}" name="{{.Name}}" {{ if isset(.Value) }} value="{{.Value}}" {{ end }} {{ yield attributes() .Attributes }} {{ if .Checked == true }} checked {{end}} /> {{ end }} </label> {{end}} {* form template *} {{block form()}} <form action="{{.Action}}" name="{{.Name}}" method="{{.Method}}"> <fieldset> {{ range .Fields }} {{yield field() .}} {{end}} </fieldset> </form> {{end}} This is the exact app structure I use to deal with dependencies and filters : https://medium.com/statuscode/how-i-write-go-http-services-a...
In Ask HN: What is the current state of web frameworks in Golang?

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.