Skip to content

Commit

Permalink
Issue webcompat#2445 - Re-enables logging capabilities and initializa…
Browse files Browse the repository at this point in the history
…tion message
  • Loading branch information
karlcow committed May 22, 2018
1 parent 4c8ff98 commit 96466bd
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from collections import namedtuple
import json
import logging
import os
import sys
import urlparse
Expand Down Expand Up @@ -92,14 +91,14 @@ def update_status_config(milestones_content):
# Check if there is a missing milestone. The app will not start.
if not set(status_names).issubset(milestone_names):
missing = set(status_names).symmetric_difference(set(milestone_names))
logging.warning(MILESTONE_UNMATCHING.format(names=list(missing)))
print(MILESTONE_UNMATCHING.format(names=list(missing)))
return None
# Check if there are more milestones than the configured ones.
# This is probably fine, but we can log a warning.
if set(status_names) < set(milestone_names):
# Extract the additional milestones
intruder = set(status_names).symmetric_difference(set(milestone_names))
logging.warning(MILESTONE_UNMATCHING.format(names=list(intruder)))
print(MILESTONE_UNMATCHING.format(names=list(intruder)))
# Assign the right id to the status.
for milestone in milestones:
if milestone['title'] in status_names:
Expand Down Expand Up @@ -171,9 +170,5 @@ def update_status_config(milestones_content):

from webcompat import app
# We need the milestones
logging.basicConfig(
filename=LOG_FILE,
format='%(levelname)s %(asctime)s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
if not initialize_status():
sys.exit('Milestones are not initialized. Check logs.')

0 comments on commit 96466bd

Please sign in to comment.