Skip to content

feat: add zerolog and slog as Go logging options#138

Merged
Marve10s merged 2 commits intomainfrom
feat/go-zerolog-slog-logging
Apr 9, 2026
Merged

feat: add zerolog and slog as Go logging options#138
Marve10s merged 2 commits intomainfrom
feat/go-zerolog-slog-logging

Conversation

@Marve10s
Copy link
Copy Markdown
Owner

@Marve10s Marve10s commented Apr 9, 2026

Summary

  • Add "zerolog" and "slog" to GoLoggingSchema alongside the existing "zap" option
  • zerolog: Zero-allocation JSON logger (github.com/rs/zerolog), fastest in benchmarks. Uses chained method calls: logger.Info().Str("key", "val").Msg("message")
  • slog: Go 1.21+ stdlib structured logging (log/slog), no external dependency. Uses variadic key-value pairs: logger.Info("message", "key", "val")

Files changed (12)

File Change
packages/types/src/schemas.ts Add "zerolog", "slog" to GoLoggingSchema enum
packages/types/src/option-metadata.ts Add label overrides for zerolog and slog
apps/cli/src/prompts/go-ecosystem.ts Add prompt options with descriptions
apps/cli/src/index.ts Update CLI description string
apps/cli/src/helpers/core/post-installation.ts Add display names for post-install
packages/template-generator/templates/go-base/go.mod.hbs Add zerolog dependency conditional (slog needs none)
packages/template-generator/templates/go-base/cmd/server/main.go.hbs Add zerolog/slog init blocks, imports, and logging calls alongside existing zap blocks
packages/template-generator/src/processors/readme-generator.ts Add README feature lines
apps/web/src/lib/constant.ts Add TECH_OPTIONS entries for web builder
apps/cli/test/go-language.test.ts Add zerolog and slog test suites
apps/cli/test/template-snapshots.test.ts Add snapshot combos
apps/cli/test/__snapshots__/template-snapshots.test.ts.snap Updated snapshots

Test plan

  • bun test apps/cli/test/cli-builder-sync.test.ts — 350 pass (2 pre-existing failures unrelated to this PR)
  • bun test apps/cli/test/go-language.test.ts — 64 pass, 0 fail
  • bun test apps/cli/test/template-snapshots.test.ts — 64 pass, 0 fail
  • Scaffold 6 combos with all framework/ORM permutations:
    1. gin + gorm + zerolog — go build ./... SUCCESS
    2. echo + sqlc + zerolog — go build ./... SUCCESS
    3. fiber + gorm + zerolog — go build ./... SUCCESS
    4. gin + gorm + slog — go build ./... SUCCESS
    5. chi + sqlc + slog — go build ./... SUCCESS
    6. fiber + none + slog — go build ./... SUCCESS
  • Verified zerolog adds github.com/rs/zerolog to go.mod
  • Verified slog adds NO external dependency to go.mod (stdlib)
  • Verified "os" import guard widened from (eq goLogging "zap") to (ne goLogging "none")

@github-actions github-actions bot added size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Apr 9, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
better-fullstack-web Ignored Ignored Preview Apr 9, 2026 7:29pm

@Marve10s Marve10s force-pushed the feat/go-zerolog-slog-logging branch 3 times, most recently from a5bc84b to 3f2ccb2 Compare April 9, 2026 15:16
@Marve10s Marve10s enabled auto-merge (squash) April 9, 2026 15:17
@Marve10s Marve10s force-pushed the feat/go-zerolog-slog-logging branch from 3f2ccb2 to 17f62d0 Compare April 9, 2026 19:01
Add two new logging libraries to the Go ecosystem alongside the
existing zap option:

- zerolog: zero-allocation JSON logger (github.com/rs/zerolog)
- slog: Go 1.21+ stdlib structured logging (no external dependency)

Both integrate with all Go web frameworks (gin, echo, fiber, chi),
ORM options (gorm, sqlc), and the gRPC API layer. All 6 tested
combinations compile successfully with go build.
@Marve10s Marve10s force-pushed the feat/go-zerolog-slog-logging branch from 17f62d0 to 806b1e4 Compare April 9, 2026 19:22
@Marve10s Marve10s merged commit 4f5307a into main Apr 9, 2026
13 checks passed
Marve10s added a commit that referenced this pull request Apr 11, 2026
## New Tools (18 additions across all ecosystems)

### TypeScript
- **Algolia** search engine (#125)
- **Vercel** deployment with compat rules (#137)
- **GraphQL Yoga + Pothos** API option (#139)
- **Tauri** desktop app addon (#142)
- **i18n** category: i18next + next-intl (#149)

### Rust
- **tracing + env-logger** logging category (#126)
- **anyhow + thiserror + eyre** error handling category (#135)
- **Diesel** ORM (#140)
- **Rocket** web framework (#143)
- **moka + redis** caching category (#144)

### Go
- **Fiber** web framework (#127)
- **Chi** web framework (#133)
- **zerolog + slog** logging (#138)
- **Ent** ORM (#145)

### Python
- **Flask** web framework (#128)
- **Litestar** web framework (#136)
- **authlib + jwt** auth category (#141)
- **Strawberry** GraphQL category (#148)

## Infrastructure
- Adding new tool options guideline (3,000+ lines, 7 files)
- PR-aware smoke tests (--force-option, --force-non-none, --partition)
- Strengthened CI: test:release expanded, smoke tests block PRs
- Compatibility rules guideline with template parity checks
- Meilisearch template fix for v0.57 API changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant