aboutsummaryrefslogtreecommitdiff
path: root/app/util/log.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/util/log.py')
-rw-r--r--app/util/log.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/util/log.py b/app/util/log.py
index 943863d..6be82e7 100644
--- a/app/util/log.py
+++ b/app/util/log.py
@@ -4,10 +4,10 @@ from ua_parser import user_agent_parser
from ip2locationio.ipgeolocation import IP2LocationIOAPIError
from database import SessionLocal
-from config import LOG, API_KEY, IP_TO_LOCATION
+import config
from models import Link, Record
-configuration = ip2locationio.Configuration(API_KEY)
+configuration = ip2locationio.Configuration(config.API_KEY)
ipgeolocation = ip2locationio.IPGeolocation(configuration)
"""
@@ -25,7 +25,7 @@ def log(link, ip, user_agent):
.first()
)
- if IP_TO_LOCATION:
+ if config.IP_TO_LOCATION:
# Get IP to GEO via IP2Location.io
try:
data = ipgeolocation.lookup(ip)
@@ -33,7 +33,7 @@ def log(link, ip, user_agent):
isp = data["as"]
# Fatal error, API key is invalid or out of requests, quit
except IP2LocationIOAPIError:
- LOG.error(
+ config.LOG.error(
"Invalid API key or insufficient credits. Change the"
" `config.ini` file if you no longer need IP geolocation."
)