-v/--verbose raises the log level per repeat; -q/--quiet prints only fatal errors #212

Closed
opened 2026-10-16 14:09:47 +02:00 by clawbot · 1 comment
Collaborator

sneak (#187 (comment)): a -v / --verbose option raises the log level, one level per repeat (-vv, -vvv, --verbose --verbose); logging goes to stderr. -q / --quiet prints nothing to stderr except fatal errors.

Done when: both options exist on every command as described, logs go only to stderr, the README and --help say so, and tests cover each level and --quiet.

Model: opus-5-5

sneak (https://git.eeqj.de/sneak/quak/issues/187#issuecomment-145043): a `-v` / `--verbose` option raises the log level, one level per repeat (`-vv`, `-vvv`, `--verbose --verbose`); logging goes to stderr. `-q` / `--quiet` prints nothing to stderr except fatal errors. **Done when:** both options exist on every command as described, logs go only to stderr, the README and `--help` say so, and tests cover each level and `--quiet`. Model: opus-5-5
Author
Collaborator

Plan. Starts after #211 is on next, since all three change bin/quak.ts and the commands' stderr lines.

  • Levels, from quietest: fatal, error, warning, info, debug, trace. The default is info: everything quak prints on stderr today, the progress lines included. -v gives debug, -vv trace; more repeats stay at trace. --verbose --verbose counts the same as -vv. Debug and trace each log something real (for example each server request with its result, and each retry), chosen by the worker and listed in the README.
  • -q / --quiet prints only fatal errors: the line printed when a command fails and exits non-zero (quak: MESSAGE, "Not logged in", an invalid ID, a collection that does not exist). A file that fails inside backup is not fatal; it is still recorded in failures.json and in the exit code.
  • -q with -v is refused with a one-line usage error.
  • Both are options of the program, so they work before or after any command name, as --cache-dir does. Counting repeats uses commander's documented way of counting a repeated option.
  • Every log line goes to stderr; stdout carries only a command's output. --json shapes stdout only, so the refresh progress lines that #214 added are info lines for every command that waits on a refresh, backup and --json runs included (today backup and --json runs are silent through a long first refresh).
  • New file src/cli-log.ts: the CLI's log level and the one function the commands write stderr lines through. No logging library is added for this. The library's layers keep reporting through their existing callbacks (onProgress), and the CLI logs what they report.
  • README "CLI surface" and --help.
  • Tests: each level (default, -v, -vv, -vvv), --verbose --verbose, -q on a failing and a working command, -q -v, and refresh progress on stderr from backup and from files --json.

Model: opus-5-5

Plan. Starts after https://git.eeqj.de/sneak/quak/issues/211 is on `next`, since all three change `bin/quak.ts` and the commands' stderr lines. - Levels, from quietest: fatal, error, warning, info, debug, trace. The default is info: everything quak prints on stderr today, the progress lines included. `-v` gives debug, `-vv` trace; more repeats stay at trace. `--verbose --verbose` counts the same as `-vv`. Debug and trace each log something real (for example each server request with its result, and each retry), chosen by the worker and listed in the README. - `-q` / `--quiet` prints only fatal errors: the line printed when a command fails and exits non-zero (`quak: MESSAGE`, "Not logged in", an invalid ID, a collection that does not exist). A file that fails inside `backup` is not fatal; it is still recorded in `failures.json` and in the exit code. - `-q` with `-v` is refused with a one-line usage error. - Both are options of the program, so they work before or after any command name, as `--cache-dir` does. Counting repeats uses commander's documented way of counting a repeated option. - Every log line goes to stderr; stdout carries only a command's output. `--json` shapes stdout only, so the refresh progress lines that https://git.eeqj.de/sneak/quak/pulls/214 added are info lines for every command that waits on a refresh, `backup` and `--json` runs included (today `backup` and `--json` runs are silent through a long first refresh). - New file `src/cli-log.ts`: the CLI's log level and the one function the commands write stderr lines through. No logging library is added for this. The library's layers keep reporting through their existing callbacks (`onProgress`), and the CLI logs what they report. - README "CLI surface" and `--help`. - Tests: each level (default, `-v`, `-vv`, `-vvv`), `--verbose --verbose`, `-q` on a failing and a working command, `-q -v`, and refresh progress on stderr from `backup` and from `files --json`. Model: opus-5-5
Sign in to join this conversation.