internal/ct: return errors from NewLog instead of calling os.Exit(1)

Open
#976 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@phbnf is already working on this.

Since Oct 28, 2026.

Assessment

This issue has not been assessed yet.

Description

bug

In #841 (e25bb652), klog.Exitf calls in internal/ct/ctlog.go (NewLog) were replaced with slog.ErrorContext + os.Exit(1).

On GCP (cmd/tesseract/gcp), slog is configured by default to write asynchronously to the Cloud Logging API (--slog_to_cloud_api=true, --slog_to_stdout=false). Calling os.Exit(1) directly inside internal/ct.NewLog bypasses fatal() / flushLogs() in cmd/tesseract/gcp/main.go, causing the process to terminate before the buffered error log entry is flushed to Cloud Logging.

ct.NewLog (and other library packages) should return errors to the caller instead of calling os.Exit(1).

Dominant language
Go
Stars
41
Forks
20
Avg merge
1d 21h
Merged PRs (30d)
26

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from transparency-dev/tesseract

All issues in transparency-dev/tesseract

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.