Implement Configuration and Log dirs classes#61
Conversation
|
Now I need to find Logs folders for Windows and Linux. On macOS now it works correctly and Logs can be found also from the Console app. |
|
On Linux: There is no standard in the XDG spec for logs, I would place it in But logging to file on Linux nowadays is not really important. A continuously running process like this should be managed by systemd, which has a robust logging system called journald, and it records everything sent to stdout. But there are still some distros not using systemd, for them this should be useful. On Windows: I have seen other programs simply log into |
|
Great, thank you for the explanations ! |
| if "XDG_CACHE_HOME" in os.environ: | ||
| return os.path.join(os.environ["XDG_CACHE_HOME"], "Logs") | ||
| else: | ||
| return os.path.join(os.environ["HOME"], ".cache", "Logs") |
There was a problem hiding this comment.
| if "XDG_CACHE_HOME" in os.environ: | |
| return os.path.join(os.environ["XDG_CACHE_HOME"], "Logs") | |
| else: | |
| return os.path.join(os.environ["HOME"], ".cache", "Logs") | |
| if "XDG_CACHE_HOME" in os.environ: | |
| return os.path.join(os.environ["XDG_CACHE_HOME"], "IoTuring", "Logs") | |
| else: | |
| return os.path.join(os.environ["HOME"], ".cache", "IoTuring", "Logs") |
These folders don't exist by default
| # get the folder on windows where to store application log file | ||
| def _windowsFolderPath(self): | ||
| # return joined local app data folder and "Logs" subfolder | ||
| return os.path.join(os.environ["LOCALAPPDATA"], "Logs") |
There was a problem hiding this comment.
| return os.path.join(os.environ["LOCALAPPDATA"], "Logs") | |
| return os.path.join(os.environ["LOCALAPPDATA"], "IoTuring", "Logs") |
Here as well, create a separate folder for IoTuring
PR that simplifies the selection of directories based on
The GetDirectory class must be extended and the subclasses only have to specify the methods to retrieve
and two variables
Reimplemented Configurations path selection with the new class and implemented the same for Logs