Skip to content

feat: add profile name to log messages#1637

Merged
Hofer-Julian merged 8 commits into
borgbase:masterfrom
diivi:feat/add-profile-info-to-log-messages
Mar 22, 2023
Merged

feat: add profile name to log messages#1637
Hofer-Julian merged 8 commits into
borgbase:masterfrom
diivi:feat/add-profile-info-to-log-messages

Conversation

@diivi
Copy link
Copy Markdown
Contributor

@diivi diivi commented Mar 8, 2023

Description

Append profile name to every log message

Related Issue

#1379

Motivation and Context

Helps the user know which profile the log is coming from.

How Has This Been Tested?

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

@real-yfprojects
Copy link
Copy Markdown
Collaborator

This would also be useful for the other messages like Backup finished.

@diivi
Copy link
Copy Markdown
Contributor Author

diivi commented Mar 8, 2023

I did this for logText (the second one) only, should I do it for the first one too, i.e. progressText (all occurences of backup_progress_event.emit)?

@real-yfprojects
Copy link
Copy Markdown
Collaborator

I did this for logText (the second one) only, should I do it for the first one too, i.e. progressText (all occurences of backup_progress_event.emit)?

Yes, since currently one has no way to tell which backup has finished.

@diivi
Copy link
Copy Markdown
Contributor Author

diivi commented Mar 9, 2023

Yes, since currently one has no way to tell which backup has finished.

So why not do this just for the Backup Finished message instead of every progress event?
Sorry, don't have much context about long running background backups.

@real-yfprojects
Copy link
Copy Markdown
Collaborator

So why not do this just for the Backup Finished message instead of every progress event?

Doesn't it also apply to other progress messages? None of them state the profile they are originating from.

@diivi
Copy link
Copy Markdown
Contributor Author

diivi commented Mar 12, 2023

Hey, I need some help understanding how I can get the profile name in the various jobs in vorta. For example the create job:

    def process_result(self, result):

Should I access result[params][profile_name] to get the profile name?
Also, what about the functions which have a signature like this: (no result)

    def started_event(self):

How do I get the profile name to display in the progress event emitted by these functions?
Or should I skip these?

@real-yfprojects
Copy link
Copy Markdown
Collaborator

This could be cleaner and better but you can always access the profile from a BorgJob with

self.params['profile_id']

@real-yfprojects
Copy link
Copy Markdown
Collaborator

I think you have to resolve the merge conflicts before the tests are run.

@real-yfprojects real-yfprojects requested a review from m3nu March 17, 2023 14:34
Copy link
Copy Markdown
Collaborator

@real-yfprojects real-yfprojects left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know a better way to use the same message template over and over again with a qt signal -- besides maybe writing a function.

@Hofer-Julian Hofer-Julian merged commit 3ebb078 into borgbase:master Mar 22, 2023
diivi added a commit to diivi/vorta that referenced this pull request Apr 11, 2023
* feat: add profile name to log messages

* update tests

* add profile name to all occurences of backup progress event emit

* update tests

* merge with logs link code

---------

Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>
real-yfprojects pushed a commit to real-yfprojects/vorta that referenced this pull request Jun 11, 2023
In a similar fashion like borgbase#1637 the commit adds the profile name to the error notification.

* src/vorta/scheduler.py
DaffyTheDuck pushed a commit to DaffyTheDuck/vorta that referenced this pull request Jun 14, 2023
* feat: add profile name to log messages

* update tests

* add profile name to all occurences of backup progress event emit

* update tests

* merge with logs link code

---------

Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>
real-yfprojects added a commit that referenced this pull request Jun 28, 2023
In a similar fashion like #1637 the commit adds the profile name to the error notification.

* src/vorta/scheduler.py

Co-authored-by: herrwusel <herrwusel@noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants