Skip to content

fix(log): stop the cache commands doubling the space in their messages (MAPCO-11672) - #35

Merged
NivGreenstein merged 1 commit into
developmentfrom
fix/log-call-site-spacing
Sep 23, 2026
Merged

NivGreenstein merged 1 commit into
developmentfrom
fix/log-call-site-spacing

Conversation

@NivGreenstein

Copy link
Copy Markdown
Collaborator

What and why

MAPCO-11672 reported that log.Error/Warn/Info/Debug emitted !BADKEY, turned the message into an attribute key, and panicked on log.Error(err). That core fix already landed in #32 (MAPCO-11544). There the helpers switched to joining their operands as fmt.Println does, and TestWrappers now covers !BADKEY, the Error(err) panic and the zero-argument call.

One thing the ticket expects still failed. Four call sites in the cache commands end their message in a space (log.Info("zoom list: ", zooms)). Println adds a space of its own, so they logged zoom list: [10 11 12] where the ticket expects zoom list: [10 11 12]. This PR drops the trailing space at those sites.

The ticket suggested fmt.Sprint instead, which would have needed no call-site changes. It was rejected because Sprint puts no space next to a string operand: log.Warn("could not purge", err) would read could not purgeboom, and provider.go:115 would read Unsupported tile SRID.3857. The rule (a message must not end in a space) is now stated in the helper's comment and in internal/log/README.md.

Verification

  • go build -mod vendor ./...
  • go test -mod vendor -race ./... (full suite, no provider gates), plus CGO_ENABLED=0 for ./internal/log/ ./cmd/...
  • gofmt -s -l is clean.
  • Every non-f call site outside vendor/ was checked by reading it: none now ends its message in a space.

Left out

  • The no-trailing-space rule is documented but not enforced by a test or lint.
  • provider.go:121 still renders the *tile_t as a &{...} struct dump. This behaviour predates this PR and the ticket does not cover it.
  • No shigola-docs change: internal/log/README.md is not in the docs-sync table.

Jira: MAPCO-11672

🤖 Generated with Claude Code

…s (MAPCO-11672)

Error, Warn, Info and Debug now join their operands as Println does, which
always inserts a space. The cache commands' messages already ended in one
("zoom list: ", zooms), so they logged "zoom list:  [10 11 12]" rather than
the single-spaced line MAPCO-11672 expects.

The helpers keep Println rather than the ticket's suggested fmt.Sprint:
Sprint puts no space next to a string operand, so ("could not purge", err)
would read "could not purgeboom". The call sites change instead, and the
helper comment and README now state the rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coveralls

coveralls commented Sep 23, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 537337546

Coverage remained the same at 56.751%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 4 uncovered changes across 3 files (0 of 4 lines covered, 0.0%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
cmd/shigola/cmd/cache/seed_purge.go 2 0 0.0%
cmd/shigola/cmd/cache/tile_list.go 1 0 0.0%
cmd/shigola/cmd/cache/tile_name.go 1 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 10606
Covered Lines: 6019
Line Coverage: 56.75%
Coverage Strength: 121.35 hits per line

💛 - Coveralls

@NivGreenstein
NivGreenstein merged commit 9422f8c into development Sep 23, 2026
15 checks passed
@NivGreenstein
NivGreenstein deleted the fix/log-call-site-spacing branch September 23, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants