A command that exits 1 because files or albums failed now ends with one fatal line saying how many failed and where to look, so -q never leaves a non-zero exit unexplained: backup points to failures.json, backup-metadata to mlDataError in each file's JSON, and fix-missing-thumbnails to its Failed files list. The progress callbacks of the backup, the metadata backup and the thumbnail helpers take a level, so every line that reports a failure is logged at error. The library's operation names are shown in plain words. The README says which lines are error and warning, and which summary lines --json replaces. Model: opus-5-5
This commit is contained in:
@@ -137,12 +137,12 @@ matters.
|
||||
|
||||
### Exit codes
|
||||
|
||||
| Code | Meaning |
|
||||
| ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `0` | The backup is complete: every original is at its save path, and no file failed. |
|
||||
| `1` | The run finished with files in `failures.json` or albums it could not decrypt or write (see "Backup layout"), or it stopped on another error, printed as one line `quak: <message>`. The next run tries again. |
|
||||
| `2` | Another backup of the same directory is running. This run sent no request and changed nothing. |
|
||||
| `3` | There is no usable session: none is saved, the saved one is corrupt, or the server no longer accepts it. Run `quak login` as the user the cron job runs as. |
|
||||
| Code | Meaning |
|
||||
| ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `0` | The backup is complete: every original is at its save path, and no file failed. |
|
||||
| `1` | The run finished with files in `failures.json` or albums it could not decrypt or write (see "Backup layout"), and its last line says how many, or it stopped on another error, printed as one line `quak: <message>`. The next run tries again. |
|
||||
| `2` | Another backup of the same directory is running. This run sent no request and changed nothing. |
|
||||
| `3` | There is no usable session: none is saved, the saved one is corrupt, or the server no longer accepts it. Run `quak login` as the user the cron job runs as. |
|
||||
|
||||
`<message>` is the error's message, followed by the message of each error that
|
||||
caused it. Under Node, as `yarn quak` runs quak, `fetch` reports every failure
|
||||
@@ -695,8 +695,31 @@ own directory under the per-user cache path.
|
||||
prints on stderr is a log line at one of six levels, from the quietest: fatal,
|
||||
error, warning, info, debug and trace. A run prints the lines at its own level
|
||||
and at every quieter one. stdout holds only the command's output, at every
|
||||
level, and `--json` changes stdout only, so a run with `--json` logs the same
|
||||
lines on stderr as one without it.
|
||||
level.
|
||||
|
||||
- Every command that exits non-zero logs a fatal line saying why, such as
|
||||
`quak: <message>`, `Not logged in`, an invalid ID or a collection that does
|
||||
not exist. A command that exits 1 because files or albums failed logs it last,
|
||||
saying how many failed and where to look: `backup` points to `failures.json`
|
||||
and its `FAILED` lines, `backup-metadata` to the `mlDataError` in the JSON of
|
||||
each such file, and `helper fix-missing-thumbnails` to its `Failed files:`
|
||||
list, or to its JSON with `--json`.
|
||||
- An error line reports something that failed: the `FAILED` lines that `backup`
|
||||
and `helper fix-missing-thumbnails` log as they work,
|
||||
`ML data of file <id> could not be read` and
|
||||
`ML data request for <n> file(s) failed` from `backup-metadata`,
|
||||
`Could not check <title>` from both thumbnail helpers, and the `Failed files:`
|
||||
list at the end of `backup` and of `helper fix-missing-thumbnails`.
|
||||
- A warning reports something that did not fail but needs your attention: after
|
||||
`logout`, that the cache directory still holds decrypted data.
|
||||
- Every other line quak logs by default is info.
|
||||
|
||||
With `--json`, a command's result on stdout takes the place of its summary on
|
||||
stderr: for `backup`, the lines from `--- Backup complete ---` to the end of its
|
||||
`Failed files:` list; for `helper list-missing-thumbnails`,
|
||||
`No missing thumbnails found.` or `<n> file(s) with missing thumbnails:`; and
|
||||
for `helper fix-missing-thumbnails`, the lines from `--- Done ---` to the end of
|
||||
its `Failed files:` list. Every other line is logged as it is without `--json`.
|
||||
|
||||
- With neither option the level is info: the lines quak prints as it works, such
|
||||
as a refresh's progress, the files a backup fetches, its summary and the files
|
||||
@@ -709,12 +732,9 @@ lines on stderr as one without it.
|
||||
URL of an upload of a thumbnail is logged without its query, which holds the
|
||||
upload's signature. More repeats stay at trace, and `--verbose --verbose` is
|
||||
`-vv`.
|
||||
- `-q` lowers it to fatal: quak prints only the line a command prints as it
|
||||
fails and exits non-zero, such as `quak: <message>`, `Not logged in`, an
|
||||
invalid ID or a collection that does not exist. A file that fails inside
|
||||
`backup` is not fatal: it is in `failures.json` and in the exit code, and
|
||||
nothing is printed for it. The prompts of `login` are not log lines, and `-q`
|
||||
leaves them as they are.
|
||||
- `-q` lowers it to fatal: a run that exits 0 prints nothing on stderr, and one
|
||||
that exits non-zero prints only its fatal lines. The prompts of `login` are
|
||||
not log lines, and `-q` leaves them as they are.
|
||||
|
||||
`-q` with `-v` is refused with one line,
|
||||
`error: option '-q, --quiet' cannot be used with option '-v, --verbose'`, and
|
||||
@@ -772,7 +792,7 @@ fails, the error is logged, each of its files is written with the reason in an
|
||||
`mlDataError` field instead of `mlData`, and the dump goes on. A file whose ML
|
||||
data does not decrypt, gunzip or parse is logged and written the same way, with
|
||||
why in `mlDataError`. The exit code is non-zero if any file was written with
|
||||
`mlDataError`.
|
||||
`mlDataError`, and the last line then says how many were.
|
||||
|
||||
`helper fix-missing-thumbnails` regenerates thumbnails for JPEG images only,
|
||||
because the bundled decoder (`jpeg-js`) decodes only JPEG. A non-JPEG image
|
||||
|
||||
Reference in New Issue
Block a user