Skip to content

Commit 5a243bf

Browse files
committed
add source info to log message
1 parent 72572d0 commit 5a243bf

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

app/services/location/csbs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ async def get_locations():
4141
:rtype: dict
4242
"""
4343
logger = logging.getLogger("services.location.csbs")
44-
logger.info("Requesting data...")
44+
logger.info("csbs Requesting data...")
4545
async with httputils.CLIENT_SESSION.get(BASE_URL) as response:
4646
text = await response.text()
4747

48-
logger.info("Data received")
48+
logger.info("csbs Data received")
4949

5050
data = list(csv.DictReader(text.splitlines()))
5151
logger.info("CSV parsed")
@@ -83,7 +83,7 @@ async def get_locations():
8383
int(item["Death"] or 0),
8484
)
8585
)
86-
logger.info("Data normalized")
86+
logger.info("csbs Data normalized")
8787

8888
# Return the locations.
8989
return locations

app/services/location/jhu.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ async def get_category(category):
5757
url = BASE_URL + "time_series_covid19_%s_global.csv" % category
5858

5959
# Request the data
60-
logger.info("Requesting data...")
60+
logger.info("jhu Requesting data...")
6161
async with httputils.CLIENT_SESSION.get(url) as response:
6262
text = await response.text()
6363

64-
logger.info("Data received")
64+
logger.info("jhu Data received")
6565

6666
# Parse the CSV.
6767
data = list(csv.DictReader(text.splitlines()))
68-
logger.info("CSV parsed")
68+
logger.info("jhu CSV parsed")
6969

7070
# The normalized locations.
7171
locations = []
@@ -98,7 +98,7 @@ async def get_category(category):
9898
"latest": int(latest or 0),
9999
}
100100
)
101-
logger.info("Data normalized")
101+
logger.info("jhu Data normalized")
102102

103103
# Latest total.
104104
latest = sum(map(lambda location: location["latest"], locations))

app/services/location/nyt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ async def get_locations():
7575
logger = logging.getLogger("services.location.nyt")
7676

7777
# Request the data.
78-
logger.info("Requesting data...")
78+
logger.info("nyt Requesting data...")
7979
async with httputils.CLIENT_SESSION.get(BASE_URL) as response:
8080
text = await response.text()
8181

8282
logger.info("Data received")
8383

8484
# Parse the CSV.
8585
data = list(csv.DictReader(text.splitlines()))
86-
logger.info("CSV parsed")
86+
logger.info("nyt CSV parsed")
8787

8888
# Group together locations (NYT data ordered by dates not location).
8989
grouped_locations = get_grouped_locations_dict(data)
@@ -125,6 +125,6 @@ async def get_locations():
125125
},
126126
)
127127
)
128-
logger.info("Data normalized")
128+
logger.info("nyt Data normalized")
129129

130130
return locations

0 commit comments

Comments
 (0)