diff --git a/config/__init__.py b/config/__init__.py index 29331fe42..eed4de307 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -10,6 +10,7 @@ import json import os import sys +import tempfile import urlparse import requests @@ -134,11 +135,16 @@ def update_status_config(milestones_content): # it will create a line with the following format # 2015-09-14 20:50:19,185 INFO: Thing_To_Log [in /codepath/views.py:127] -LOG_FILE = '/tmp/webcompat.log' +# set the tempdir to somewhere predictable, no matter the platform +tempfile.tempdir = os.path.join(os.getcwd(), 'tmp') +print('Writing logs to: {}'.format(tempfile.gettempdir())) + +LOG_FILE = os.path.join(tempfile.gettempdir(), 'webcompat.log') if STAGING: - LOG_FILE = '/tmp/staging-webcompat.log' + LOG_FILE = os.path.join(tempfile.gettempdir(), 'staging-webcompat.log') LOG_FMT = '%(asctime)s tracking %(message)s' -CSP_REPORTS_LOG = '/tmp/webcompat-csp-reports.log' +CSP_REPORTS_LOG = os.path.join( + tempfile.gettempdir(), 'webcompat-csp-reports.log') # Status categories used in the project # 'new', 'needsdiagnosis', 'needscontact', 'contactready' , 'sitewait', 'close' diff --git a/docs/dev-env-setup.md b/docs/dev-env-setup.md index 96fda695d..25dc85e77 100644 --- a/docs/dev-env-setup.md +++ b/docs/dev-env-setup.md @@ -184,10 +184,6 @@ You can now edit `secrets.py` and ![Auth 404](https://i.cloudup.com/8FDA5bVc7l.png) -### Updating __init__.py file - -Make sure `tmp` folder is updated with `temp` for Windows - ### Starting The Server ```bash @@ -207,7 +203,16 @@ You should now have a local instance of the site running at `http://localhost:50 #### Getting error messages? Please [file bugs](https://github.com/webcompat/webcompat.com/issues/new) in case you need further assistance. -First you should have a look at the logs. They are located at `/tmp/webcompat.log` (Linux/Mac) or `/temp/webcompat.log` (Windows). +First you should have a look at the logs located in `webcompat.com/tmp`. + +When you start the local server, it will also print the location to the console: + +```bash +> python run.py +Statuses Initialization… +Writing logs to: /Users/acooluser/projects/webcompat.com/tmp +… +``` ### Building the Project