Commit Graph
10 Commits
Author SHA1 Message Date
clawbot bbd92df20f Give the webhook handler a timeout (closes #38)
check / check (push) Successful in 52s
check / check (pull_request) Successful in 35s
The webhook handler's client had no timeout, and slog calls the handler
inside the log call, so a server that accepted the connection and never
answered stopped that log call for good, and every later one. A request
still running after 5 seconds, reading the answer included, now fails
with a timeout error. The handler also reads the answer to the end
before closing it, so the connection is reused for the next record.

Two new tests point the handler at a server that never answers and at
one that sends its status and then stalls the answer, and check that
Handle returns a timeout error within the timeout. The README states
the timeout.

Model: opus-5-5
2026-10-06 10:47:54 +00:00
clawbot 8e53530434 Run the linter only in Docker (closes #20)
check / check (push) Successful in 48s
script/lint now builds only the lint stage of the Dockerfile, without
the build cache, so every run executes the linter; the image is tagged
simplelog-lint. The lint stage calls golangci-lint directly, since make
lint is itself a docker build of that stage. script/cibuild and
script/docker also build without the cache, so their check steps always
run. script/fmt no longer runs golangci-lint --fix, and script/bootstrap
no longer installs it. golangci-lint config verify is left out, on the
owner's ruling. The README, TODO.md and the script/cibuild comment say
what now runs.

Model: opus-5-5
2026-10-06 09:41:32 +02:00
clawbot 151dd42b4b Return sink write errors from every handler (closes #22)
check / check (push) Successful in 35s
The console and JSON handlers threw away the error from their write to
stdout, so a lost log line looked delivered. They now return it,
wrapped. The webhook handler also returns an error for a status outside
2xx, and no longer follows redirects, which could resend the request
without the record. The multiplex handler passes the record to every
handler and returns their errors joined with errors.Join instead of
stopping at the first.

Both stdout handlers gain an unexported writer, nil meaning os.Stdout at
write time, so tests can supply a sink that fails. The README says what
each handler returns and that the slog.Logger methods discard a
handler's error.

Model: opus-5-5
2026-10-06 08:45:17 +02:00
sneak 2c3c35095b Bring main's fixes into next (closes #16)
check / check (push) Failing after 2s
check / check (pull_request) Failing after 2s
Merges main into next as a two-parent merge, so main becomes an ancestor
of next and the later merge of next into main does not conflict. This
brings in golangci-lint v2.12.2 with .golangci.yml, and the fix that
makes every handler emit slog attributes.

README.md and TODO.md conflicted. README.md keeps main's Attribute
output section, followed by next's Entrypoints section. TODO.md keeps
the completed steps from both sides, newest first. The other files
merged cleanly: the Makefile is still next's script/ shims, and the
Dockerfile has main's v2.12.2 lint image.

Model: opus-5-5
2026-10-05 23:22:45 +00:00
sneak 86436449c5 Emit slog attributes from every handler (closes #19, closes #24)
check / check (push) Successful in 34s
check / check (pull_request) Successful in 32s
Handle never read the record's attributes, and WithAttrs and WithGroup
returned the receiver unchanged. The JSON and webhook handlers also marshaled
slog.Record itself, whose attributes are unexported.

Each handler now carries a handlerAttrs value, copied rather than mutated, so
sibling loggers cannot leak attributes into each other. JSON and webhook
output nest groups as objects; the console appends key=value pairs with dotted
group keys, quoted as slog.NewTextHandler quotes them, invalid UTF-8
included. Logged values are never written to. In JSON the record's own fields
win a key collision, and a repeated key keeps its last value unless both are
groups, which merge; the README documents both.

Deviation: DEL is quoted on the console; the stdlib leaves it bare.

Model: opus-5-5
2026-09-28 10:49:46 +00:00
sneak 5cb4f827d2 Adopt scripts-to-rule-them-all: script/ entrypoints, Makefile shims 2026-07-07 01:54:40 +02:00
sneak 31c9ed52cb preparing for 1.0 2024-06-14 05:53:22 -07:00
sneak d8f35dd031 closer to ready 2024-06-10 02:39:01 -07:00
sneak 60cb410c32 update module path 2024-05-22 14:53:57 -07:00
sneak f21c916eb3 initial 2024-05-13 21:43:47 -07:00