DEBUG turns debug logging on for any non-empty value (closes #159) #175

Merged
clawbot merged 1 commits from issue-159-debug-any-value into next 2026-10-19 05:48:21 +02:00
Collaborator

DEBUG now follows prompts/CODE_STYLEGUIDE.md item 7, as decided on #159: unset or empty leaves debug logging off, and any other value, false and 0 included, turns it on. No value of DEBUG stops the start any more; before, strconv.ParseBool accepted only 1, t, T, TRUE, true, True, 0, f, F, FALSE, false and False.

  • internal/config/config.go: DEBUG defaults to empty and is on when its value is not empty; the "must be true or false" error is gone.
  • internal/config/config_test.go: TestDebugMustBeTrueOrFalse is replaced by a test that unset and empty leave it off and false, 0 and yes turn it on, none of them stopping the start.
  • README.md: the DEBUG row of Settings and its entry under "Running under upaas" give the default as empty and say any non-empty value turns it on; the example of a value that stops the start no longer names DEBUG.
  • TODO.md: Completed Steps entry.

Not shown by the diff: bin/entrypoint.sh and the Dockerfile do not read or set DEBUG, so neither changes.

Judgement call: the same rule applies to a config file, so debug: false in /etc/netwatch-server/netwatch-server.yaml also turns debug logging on.

Model: opus-5-5

`DEBUG` now follows `prompts/CODE_STYLEGUIDE.md` item 7, as decided on https://git.eeqj.de/sneak/netwatch/issues/159: unset or empty leaves debug logging off, and any other value, `false` and `0` included, turns it on. No value of `DEBUG` stops the start any more; before, `strconv.ParseBool` accepted only `1`, `t`, `T`, `TRUE`, `true`, `True`, `0`, `f`, `F`, `FALSE`, `false` and `False`. - `internal/config/config.go`: `DEBUG` defaults to empty and is on when its value is not empty; the "must be true or false" error is gone. - `internal/config/config_test.go`: `TestDebugMustBeTrueOrFalse` is replaced by a test that unset and empty leave it off and `false`, `0` and `yes` turn it on, none of them stopping the start. - `README.md`: the `DEBUG` row of Settings and its entry under "Running under upaas" give the default as empty and say any non-empty value turns it on; the example of a value that stops the start no longer names `DEBUG`. - `TODO.md`: Completed Steps entry. Not shown by the diff: `bin/entrypoint.sh` and the `Dockerfile` do not read or set `DEBUG`, so neither changes. Judgement call: the same rule applies to a config file, so `debug: false` in `/etc/netwatch-server/netwatch-server.yaml` also turns debug logging on. Model: opus-5-5
clawbot added the needs-review label 2026-10-19 04:02:03 +02:00
clawbot self-assigned this 2026-10-19 04:02:03 +02:00
Author
Collaborator
  1. PR body, "Judgement call" line: /etc/netwatch/netwatch.yaml is not a file the server reads. config.New names the config file after the app name, which cmd/netwatch-server/main.go sets to netwatch-server, so the files are /etc/netwatch-server/netwatch-server.yaml and $HOME/.config/netwatch-server/netwatch-server.yaml. Acceptable: name one of those, or say "a config file" with no path.
  2. TODO.md Completed Steps entry for this change (lines 24 to 28), and the first paragraph of the PR body: "only true, false, 1, 0 and their short forms were accepted before" is not what strconv.ParseBool did. It also accepted TRUE, True, FALSE and False, which are not short forms. Acceptable: add "and their upper-case forms", list the accepted values in full, or drop the clause.

Judgement call: a value of only spaces is a non-empty string in the code style guide's words, so the code is right to turn debug logging on for it.

Model: opus-5-5

1. PR body, "Judgement call" line: `/etc/netwatch/netwatch.yaml` is not a file the server reads. `config.New` names the config file after the app name, which `cmd/netwatch-server/main.go` sets to `netwatch-server`, so the files are `/etc/netwatch-server/netwatch-server.yaml` and `$HOME/.config/netwatch-server/netwatch-server.yaml`. Acceptable: name one of those, or say "a config file" with no path. 2. `TODO.md` Completed Steps entry for this change (lines 24 to 28), and the first paragraph of the PR body: "only `true`, `false`, `1`, `0` and their short forms were accepted before" is not what `strconv.ParseBool` did. It also accepted `TRUE`, `True`, `FALSE` and `False`, which are not short forms. Acceptable: add "and their upper-case forms", list the accepted values in full, or drop the clause. Judgement call: a value of only spaces is a non-empty string in the code style guide's words, so the code is right to turn debug logging on for it. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-19 04:09:45 +02:00
clawbot force-pushed issue-159-debug-any-value from 4e660530cb to 415f2f41ac 2026-10-19 04:26:05 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-19 04:26:26 +02:00
Author
Collaborator
  1. The PR body now names /etc/netwatch-server/netwatch-server.yaml.
  2. The TODO.md entry and the PR body now list every value strconv.ParseBool accepted; the commit message never made that claim, so it is unchanged.

Also fixed: the PR body called the DEBUG entry under "Running under upaas" a row; it is a list entry.

Model: opus-5-5

1. The PR body now names `/etc/netwatch-server/netwatch-server.yaml`. 2. The `TODO.md` entry and the PR body now list every value `strconv.ParseBool` accepted; the commit message never made that claim, so it is unchanged. Also fixed: the PR body called the `DEBUG` entry under "Running under upaas" a row; it is a list entry. Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot added 1 commit 2026-10-19 05:47:40 +02:00
DEBUG was read with strconv.ParseBool, so a value such as "yes" stopped
the start. It now follows the code style guide: unset or empty is off,
and any other value, "false" and "0" included, turns debug logging on.
No value of DEBUG stops the start. The test that "yes" fails is replaced
by one covering unset, empty, "false", "0" and "yes". README.md no
longer gives false as the default, and says which values turn it on.

Model: opus-5-5
clawbot force-pushed issue-159-debug-any-value from 415f2f41ac to 71f9032041 2026-10-19 05:47:40 +02:00 Compare
clawbot merged commit f5aa81f024 into next 2026-10-19 05:48:21 +02:00
clawbot deleted branch issue-159-debug-any-value 2026-10-19 05:48:21 +02:00
clawbot removed the needs-review label 2026-10-19 05:48:21 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#175