Added debug message that logs borg version for every config #792

Merged
witten merged 2 commits from :main into main 2023-11-25 03:59:40 +00:00
Contributor
No description provided.
IBims1NicerTobi added 1 commit 2023-11-18 00:32:08 +00:00
Author
Contributor

@witten are you not interested in merging this yet or did you not get around to look at it?

@witten are you not interested in merging this yet or did you not get around to look at it?
Owner

Did not get around to looking yet, sorry! I'm kind of underwater on borgmatic stuff at the moment. Barely managed to squeeze out a release. I'll have a look at this hopefully this week.

Did not get around to looking yet, sorry! I'm kind of underwater on borgmatic stuff at the moment. Barely managed to squeeze out a release. I'll have a look at this hopefully this week.
witten reviewed 2023-11-23 06:50:35 +00:00
@ -77,1 +77,4 @@
local_borg_version = borg_version.local_borg_version(config, local_path)
yield from log_error_records(
f'{config_filename}: Local Borg version: {local_borg_version}', levelno=logging.DEBUG
)
Owner

This should probably just be a logger.debug() or logger.info() call since it's not an error...? Unfortunately though such a change would obsolete some of your laborious test work. But the good news is it might actually make your test changes easier to mock.

Let me know your thoughts.

This should probably just be a `logger.debug()` or `logger.info()` call since it's not an error...? Unfortunately though such a change would obsolete some of your laborious test work. But the good news is it might actually make your test changes easier to mock. Let me know your thoughts.
Author
Contributor

Yes that does indeed make a lot of sense and explains why the unit tests were such a pain.

Yes that does indeed make a lot of sense and explains why the unit tests were such a pain.
Author
Contributor

Fixed now

Fixed now
IBims1NicerTobi force-pushed main from a20e1e95d8 to 8b9abc6cf8 2023-11-23 10:44:18 +00:00 Compare
IBims1NicerTobi added 1 commit 2023-11-23 10:46:18 +00:00
Author
Contributor

Another question that's still up for debate is when to log all the versions. In the old pull request I did it in run_configuration() but that implies that we log everything multiple times since (I assume) for multiple configs this gets called for each one. Since the python version, borgmatic version and os should never change between config files it would probably be better to log them closer to startup than that so they only get logged once instead.

Another question that's still up for debate is when to log all the versions. In the old pull request I did it in `run_configuration()` but that implies that we log everything multiple times since (I assume) for multiple configs this gets called for each one. Since the python version, borgmatic version and os should never change between config files it would probably be better to log them closer to startup than that so they only get logged once instead.
Owner

Since the python version, borgmatic version and os should never change between config files it would probably be better to log them closer to startup than that so they only get logged once instead.

Yes, that makes sense to me! I think it's fine if not everything is logged in the exact same place—some globally and some per-config as appropriate.

> Since the python version, borgmatic version and os should never change between config files it would probably be better to log them closer to startup than that so they only get logged once instead. Yes, that makes sense to me! I think it's fine if not everything is logged in the exact same place—some globally and some per-config as appropriate.
witten reviewed 2023-11-23 16:46:41 +00:00
witten left a comment
Owner

Looks good! I think it does make sense to log this here because it could vary between configuration files if the local path option varies. But I'd recommend capitalizing Borg here because convention.

Looks good! I think it does make sense to log this here because it *could* vary between configuration files if the local path option varies. But I'd recommend capitalizing Borg here because convention.
Author
Contributor

What convention? borg is normally always written as borg not Borg, at least I have never seen it written that way anywhere?

What convention? borg is normally always written as `borg` not `Borg`, at least I have never seen it written that way anywhere?
Owner

The convention at least in borgmatic documentation and error messages is to call it "Borg" (as per the Borg docs). borgmatic, on the other hand, is always lowercase!

The convention at least in borgmatic documentation and error messages is to call it "Borg" (as per the [Borg docs](https://www.borgbackup.org/)). borgmatic, on the other hand, is always lowercase!
IBims1NicerTobi added 1 commit 2023-11-24 17:47:48 +00:00
Author
Contributor

Fixed now

Fixed now
Owner

Thank you! Did you want me to merge just this change or did you want to do the rest of the ticket in this PR?

Thank you! Did you want me to merge just this change or did you want to do the rest of the ticket in this PR?
Author
Contributor

Just this
I will do all the information separately later and I think there is a lot of room for discussion on how and were to implement the rest.

Just this I will do all the information separately later and I think there is a lot of room for discussion on how and were to implement the rest.
Owner

Sounds good!

Sounds good!
witten merged commit e120dff9ff into main 2023-11-25 03:59:40 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#792
No description provided.