borgmatic --json info
outputs non-json warnings
#602
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#602
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
Parse the output of
borgmatic --json info
in other scripts.Steps to reproduce (if a bug)
Run
borgmatic --json info 2>/dev/null
with repositories configured to use deprecated SSH location syntax likeuser@host:backups
.Actual behavior (if a bug)
The above
borgmatic
command (which discards stderr output) will output something like this:Expected behavior (if a bug)
Whne using
--json
, only parse-able JSON should go to stdout. Other messages should go to stderr. Otherwise, tools that parse the output will break.Other notes / implementation ideas
Environment
borgmatic version: 1.7.4
borgmatic installation method: pex
Borg version: 1.1.16
Python version: 3.9.2
operating system and version: Debian Bullseye
Good find, and thank you for filing this!
This is fixed in master and will be part of the next release. Warnings now go to stderr instead of stdout. In order to make this possible, I had to stop abusing the warning level and make certain logs (such as the output of
borgmatic list
) go to a new custom log level so they'd still show up on stdout.Thanks again for filing this!
Just released in borgmatic 1.7.6!