Skip to content

Conversation

@ivanauth
Copy link
Contributor

@ivanauth ivanauth commented Dec 17, 2025

Fixes #889

Async logging was disabled because nothing was flushing the diode.Writer buffer on shutdown - logs were getting lost. The cobrazerolog library hides the closer so we couldn't fix it there.

This creates our own logging setup that exposes the closer, stores it globally, and flushes it via defer log.Close() in main. Also restructured main() to return an int so defers actually run before exit.

@ivanauth ivanauth requested a review from a team as a code owner December 17, 2025 17:21
@github-actions github-actions bot added the area/cli Affects the command line label Dec 17, 2025
@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

❌ Patch coverage is 85.08772% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.72%. Comparing base (7519ee2) to head (3b4d309).

Files with missing lines Patch % Lines
cmd/spicedb/main.go 0.00% 10 Missing ⚠️
pkg/cmd/server/logging_run_e.go 88.89% 3 Missing and 2 partials ⚠️
internal/logging/logger.go 96.56% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2779      +/-   ##
==========================================
+ Coverage   77.72%   77.72%   +0.01%     
==========================================
  Files         472      473       +1     
  Lines       49716    49831     +115     
==========================================
+ Hits        38636    38728      +92     
- Misses       8228     8247      +19     
- Partials     2852     2856       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ivanauth ivanauth marked this pull request as draft December 17, 2025 17:40
@ivanauth ivanauth force-pushed the fix-async-logging-889 branch from d4136c5 to d5db6cf Compare December 17, 2025 18:01
@github-actions github-actions bot added the area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) label Dec 17, 2025
@ivanauth ivanauth force-pushed the fix-async-logging-889 branch 5 times, most recently from 69f829f to acc473d Compare December 17, 2025 21:09
@ivanauth ivanauth force-pushed the fix-async-logging-889 branch from acc473d to 3b4d309 Compare December 17, 2025 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli Affects the command line area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

re-enable async logging

1 participant