Skip to content

chore(example): use the current logger API in the standalone example - #110

Merged
juicycleff merged 2 commits into
mainfrom
chore/example-new-logger-api
Sep 6, 2026
Merged

chore(example): use the current logger API in the standalone example#110
juicycleff merged 2 commits into
mainfrom
chore/example-new-logger-api

Conversation

@juicycleff

Copy link
Copy Markdown
Contributor

The standalone example still constructs its logger with
log.NewBeautifulLogger, which go-utils v1.3.0 keeps working as a deprecated
shim. An example is the wrong place to demonstrate a deprecated constructor.

- logger := log.NewBeautifulLogger("authsome")
+ logger := log.New(log.Config{Name: "authsome"})

Behaviour is identical. The added comment records what that behaviour is, since
it is no longer implied by the constructor's name: the format is chosen from the
output, a terminal getting aligned coloured columns and anything else JSON, with
FORGE_LOG_FORMAT overriding both.

One line plus its comment. This is the last piece of the go-utils v1.3.0
adoption — the version bumps are already on main via 2ceff13, and #108 was
closed as stale once those landed.

Heads up: ci / Lint is red on main, unrelated to this

golangci-lint reports 6 findings on current main, none of them in
_examples. Verified by stashing this change and re-running: the same 6 appear.

middleware/client_autorefresh_test.go  bodyclose ×3, noctx, unparam
sdk/go/client_refresh.go               errcheck

They came in with c472f0b fix: fixed the client refresh, after #109 cleared
the retention findings. Happy to fix them in a follow-up in the same shape as
#109 — say the word.

The standalone example still constructed its logger with
log.NewBeautifulLogger, which go-utils v1.3.0 keeps working as a deprecated
shim. An example is the wrong place to demonstrate a deprecated constructor, so
it now uses log.New(log.Config{Name: "authsome"}).

Behaviour is the same either way. The comment records what that behaviour is,
since it is no longer implied by the constructor's name: the format is chosen
from the output, a terminal getting aligned coloured columns and anything else
JSON, with FORGE_LOG_FORMAT overriding both.

One line plus its comment. This is the last piece of the go-utils v1.3.0
adoption; the version bumps are already on main via 2ceff13.
@juicycleff
juicycleff merged commit a5f4584 into main Sep 6, 2026
14 checks passed
@juicycleff
juicycleff deleted the chore/example-new-logger-api branch September 6, 2026 22:45
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.

1 participant