Skip to content

Commit 42a4469

Browse files
author
ExpDev07
committed
changed to using LOGGER
1 parent e011861 commit 42a4469

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

app/utils/countrycodes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import logging
12
from itertools import chain
23

4+
5+
LOGGER = logging.getLogger(__name__)
6+
37
# Default country code.
48
default_code = "XX"
59

@@ -378,7 +382,7 @@ def country_code(country):
378382

379383
# Default picked?
380384
if country_code == default_code:
381-
print("No country_code found for '%s'. Using '%s'!" % (country, country_code))
385+
LOGGER.warning(f"No country_code found for '{country}'. Using '{country_code}'!")
382386

383387
# Return.
384388
return country_code

app/utils/populations.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import logging
12
from io import BytesIO, StringIO
23
from zipfile import ZipFile, ZipInfo
34

@@ -7,6 +8,8 @@
78
from .countrycodes import country_code
89

910

11+
LOGGER = logging.getLogger(__name__)
12+
1013
# Fetching of the populations.
1114
def fetch_populations():
1215
"""
@@ -15,7 +18,7 @@ def fetch_populations():
1518
:returns: The mapping of populations.
1619
:rtype: dict
1720
"""
18-
print("Fetching populations...")
21+
LOGGER.info("Fetching populations...")
1922

2023
# Mapping of populations
2124
mappings = {}

0 commit comments

Comments
 (0)