# Zap vs Logrus: source lines of code compared

The Zap vs Logrus comparison on OctoCounts shows side-by-side source line counts for uber-go/zap and sirupsen/logrus, counted with the same engine and analysis options on the dates shown in the methodology line: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

As of 2026-09-16, uber-go/zap contains 25,388 total lines (16,532 code) across 150 files, while sirupsen/logrus contains 6,416 total lines (4,386 code) across 52 files as of 2026-09-16. uber-go/zap is about 3.8x the size of sirupsen/logrus by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [uber-go/zap](https://octocounts.com/github/uber-go/zap) | [sirupsen/logrus](https://octocounts.com/github/sirupsen/logrus) |
| --- | ---: | ---: |
| Files | 150 | 52 |
| Total lines | 25,388 | 6,416 |
| Code lines | 16,532 | 4,386 |
| Comment lines | 6,063 | 954 |
| Blank lines | 2,793 | 1,076 |
| Languages counted | 5 | 3 |

Top languages in uber-go/zap: Go (99.4% of code), Makefile (0.3% of code), YAML (0.2% of code). Top languages in sirupsen/logrus: Go (99.8% of code), Shell (0.2% of code), Markdown (0.0% of code). Go, Shell, Markdown appear in both top language lists; Makefile, YAML appear only in uber-go/zap's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. uber-go/zap was counted at ref bb1a55dd13257cf7cbd06b4146674c67ca614dea (commit bb1a55dd1325) on 2026-09-16; sirupsen/logrus was counted at ref 70b809335b84c8f42c95060a35f86e50db7bb156 (commit 70b809335b84) on 2026-09-16. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

uber-go/zap counts the Zap repository — Uber's structured logging library for Go — while sirupsen/logrus counts the Logrus repository, the older Go logging library whose API many other Go packages adopted. Both are single-purpose Go libraries rather than frameworks, counted with the same engine on the dates above, making this one of the more like-for-like comparisons on this site.

Both repositories are Go codebases, as the per-language tables show; the comparison on the page is between two implementations of the same library role rather than across languages or architectures.

Logrus's repository carries a longer history — more years of issues-driven additions, tests, and documentation in the counted tree — so its total reflects accumulated material as much as current functionality.

_Library size does not measure logging performance or suitability: allocation behavior, API shape, and maintenance status are properties not visible in source-line counts. Logrus is widely known to be in maintenance mode, which no line count will show._

Sources: [uber-go/zap repository (structured logging library)](https://github.com/uber-go/zap) · [sirupsen/logrus repository](https://github.com/sirupsen/logrus). Statements verified 2026-09-16.

Evidence and next steps:

- [uber-go/zap SLOC report](https://octocounts.com/github/uber-go/zap)
- [sirupsen/logrus SLOC report](https://octocounts.com/github/sirupsen/logrus)
- [Compare uber-go/zap and sirupsen/logrus interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fuber-go%2Fzap&right=https%3A%2F%2Fgithub.com%2Fsirupsen%2Flogrus)

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

## Compare FAQ

### Which has more lines of code, uber-go/zap or sirupsen/logrus?

uber-go/zap has more code: 16,532 code lines versus 4,386 for sirupsen/logrus, about 3.8x as much, based on cached OctoCounts reports as of 2026-09-16.

### Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for uber-go/zap, sirupsen/logrus, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. uber-go/zap was counted at ref bb1a55dd13257cf7cbd06b4146674c67ca614dea (commit bb1a55dd1325) on 2026-09-16; sirupsen/logrus was counted at ref 70b809335b84c8f42c95060a35f86e50db7bb156 (commit 70b809335b84) on 2026-09-16. See the counting methodology for ignored directories and analysis options.

### Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.

## Related OctoCounts pages

- [Interactive repository comparison](https://octocounts.com/compare)
- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [OctoCounts API docs](https://octocounts.com/docs/api)
