-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Configuration and Log dirs classes #61
base: main
Are you sure you want to change the base?
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 ! |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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