bit-team / backintime

Back In Time - An easy-to-use backup tool for GNU/Linux using rsync in the back
https://backintime.readthedocs.io
GNU General Public License v2.0
2.09k stars 204 forks source link

chore: Show process id in debug messages (#1792) #1814

Closed buhtz closed 3 months ago

buhtz commented 3 months ago

The process id is shown in each debug message. This is helpfull to distinguish several BIT process running at the same time.

Beside of that did some PEP8 code cleaning and removed deprecated code. The class Execute distinguished between subprocess.Popen() (using list[str]) and os.system() (using str). I removed the use of os.system() and the related code. Also checked via git grep if it is used in the wild. Also add a RuntimeError catching the unexpected behavior, that should not happen today.

Before

DEBUG: [common/configfile.py:591 Config.setCurrentProfile] Change current profile: 1=Hauptprofil
DEBUG: [common/tools.py:225 initiate_translation] No language code. Use systems current locale.
DEBUG: [common/tools.py:274 set_lc_time_by_language_code] Try to set locale.LC_TIME to "de_DE.UTF-8" based on language code "de".
DEBUG: [common/backintime.py:696 getConfig] config file: /home/user/.config/backintime/config
DEBUG: [common/backintime.py:697 getConfig] share path: /home/user/.local/share/backintime
DEBUG: [common/backintime.py:698 getConfig] profiles: 1=Hauptprofil, 4=MyAppData_SSH, 5=ARCHIV_SSH, 7=Dokumente_SSH, 2=Musik_SSH, 8=Bilder_SSH, 9=share_SSH, 3=playground, 6=unittest

After

DEBUG: [17954:common/configfile.py:591 Config.setCurrentProfile] Change current profile: 1=Hauptprofil
DEBUG: [17954:common/tools.py:224 initiate_translation] No language code. Use systems current locale.
DEBUG: [17954:common/tools.py:273 set_lc_time_by_language_code] Try to set locale.LC_TIME to "de_DE.UTF-8" based on language code "de".
DEBUG: [17954:common/backintime.py:696 getConfig] config file: /home/user/.config/backintime/config
DEBUG: [17954:common/backintime.py:697 getConfig] share path: /home/user/.local/share/backintime

Close #1792

buhtz commented 3 months ago

ToDo: Check the syslog/journalctl entries. Don't add PID to syslog because it shows the PID by default.

buhtz commented 3 months ago

Decided to remove the PID-in-debug-output feature again. No need for it because you can see the PID in the syslog/journalctl.