* Move the ClientAfter calls to before the decode
ClientAfter is documented as running _prior_ to being decoded. But, this
was only partly true. They were run prior to decode, but after the
jsonrpc unmarshalling,
As the callback uses the bare response object, and at least for me, is
used to debug what's seen on the wire, this seems incorrect.
* tests
Before this fix, the build would fail, as IsTerminal isn't defined on
that platform:
$ GOOS=js GOARCH=wasm go build
# github.com/go-kit/kit/log/term
./term.go:14:6: undefined: IsTerminal
The reason is pretty simple; js/wasm doesn't have syscalls, and thus it
doesn't have an "is a terminal" syscall.
Grouping it with appengine to always assume that the output is not a
terminal is good enough for now, as it at least makes the package build.
No change is needed in any other file, because none of the other
IsTerminal +build lines include js/wasm in any way.
enhancement suggested in:
https://github.com/go-kit/kit/issues/991
why?
if a human is reading logfmt output on the
shell or in the web browser, it helps to
have certain fields prefixed, e.g. ts,
but certain fields are better suffixed,
e.g. caller, environment, so that more
important information appears first.
benchmarks suggest an additional cost
only if WithSuffix is used.
goos: darwin
goarch: amd64
pkg: github.com/go-kit/kit/log
BenchmarkDiscard-4 32230156 38 ns/op 32 B/op 1 allocs/op
BenchmarkOneWith-4 9647907 122 ns/op 96 B/op 2 allocs/op
BenchmarkTwoWith-4 8935790 134 ns/op 160 B/op 2 allocs/op
BenchmarkTenWith-4 5016836 236 ns/op 672 B/op 2 allocs/op
BenchmarkOneWithPrefix-4 9907198 123 ns/op 96 B/op 2 allocs/op
BenchmarkTenWithPrefix-4 5076309 239 ns/op 672 B/op 2 allocs/op
BenchmarkOneWithSuffix-4 6432942 189 ns/op 128 B/op 3 allocs/op
BenchmarkTenWithSuffix-4 4899711 246 ns/op 416 B/op 3 allocs/op
BenchmarkOneWithPrefixSuffix-4 6111750 197 ns/op 160 B/op 3 allocs/op
BenchmarkTenWithPrefixSuffix-4 2172066 555 ns/op 1952 B/op 3 allocs/op
PASS
ok github.com/go-kit/kit/log 14.224s
* Add GitHub Actions workflow
* Lock versions where possible
* Synchronize docker-compose file with GH Actions
* Build using latest unstable version
* Update badges
* Remove github-actions branch from config
* Cleanup old CI configs
* Remove if from coverage upload
Co-authored-by: Peter Bourgon <peterbourgon@users.noreply.github.com>