Improve logging

pull/78/head
Konstantin Gründger 2020-11-20 21:26:10 +01:00
rodzic 4c157bff4a
commit c63847a576
3 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -8,7 +8,6 @@ import click
from tqdm import tqdm from tqdm import tqdm
from ogn.client import AprsClient from ogn.client import AprsClient
from ogn.parser import parse
from app import redis_client from app import redis_client
from app.gateway.beacon_conversion import aprs_string_to_message from app.gateway.beacon_conversion import aprs_string_to_message

Wyświetl plik

@ -1,3 +1,5 @@
from flask import current_app
from mgrs import MGRS from mgrs import MGRS
from ogn.parser import parse from ogn.parser import parse
@ -14,7 +16,7 @@ def aprs_string_to_message(aprs_string):
try: try:
message = parse(aprs_string, calculate_relations=True) message = parse(aprs_string, calculate_relations=True)
except Exception as e: except Exception as e:
print(e) current_app.logger.debug(e)
return None return None
if message['aprs_type'] not in ('position', 'status'): if message['aprs_type'] not in ('position', 'status'):

Wyświetl plik

@ -3,6 +3,8 @@ import gzip
from io import StringIO from io import StringIO
from datetime import datetime, timedelta from datetime import datetime, timedelta
from flask import current_app
from aerofiles.seeyou import Reader from aerofiles.seeyou import Reader
from ogn.parser.utils import FEETS_TO_METER from ogn.parser.utils import FEETS_TO_METER
import requests import requests
@ -118,7 +120,7 @@ def get_airports(cupfile):
airports.append(airport) airports.append(airport)
except AttributeError as e: except AttributeError as e:
print("Failed to parse line: {} {}".format(line, e)) current_app.logger.error("Failed to parse line: {} {}".format(line, e))
return airports return airports