-
Notifications
You must be signed in to change notification settings - Fork 16
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
Modify log file location #19
base: master
Are you sure you want to change the base?
Conversation
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.
Can you take a look at my two comments on the pi_sht1x/logging.py file? If you can fix those I'll get this merged and do another release. Apologies for the delay getting back to this.
pi_sht1x/logging.py
Outdated
@@ -1,9 +1,10 @@ | |||
from os import path | |||
import os |
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.
I'd prefer to use the previous import to scope the import to path, which is all we need here.
@@ -13,10 +14,11 @@ def create_logger(name): | |||
in case there was a logger with the same name. | |||
""" | |||
logger = getLogger(name) | |||
log_filename = path.join(path.dirname(path.realpath(__file__)), LOG_FILE_NAME) | |||
log_filename = os.path.join(_get_log_folder(), LOG_FILE_NAME) |
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 you change the import above you can change this to path.join.
Move the log file from the module installation directory to the user HOME directory.