kopia lustrzana https://github.com/glidernet/ogn-python
Improve logging
rodzic
4c157bff4a
commit
c63847a576
|
@ -8,7 +8,6 @@ import click
|
|||
from tqdm import tqdm
|
||||
|
||||
from ogn.client import AprsClient
|
||||
from ogn.parser import parse
|
||||
|
||||
from app import redis_client
|
||||
from app.gateway.beacon_conversion import aprs_string_to_message
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from flask import current_app
|
||||
|
||||
from mgrs import MGRS
|
||||
|
||||
from ogn.parser import parse
|
||||
|
@ -14,7 +16,7 @@ def aprs_string_to_message(aprs_string):
|
|||
try:
|
||||
message = parse(aprs_string, calculate_relations=True)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
current_app.logger.debug(e)
|
||||
return None
|
||||
|
||||
if message['aprs_type'] not in ('position', 'status'):
|
||||
|
|
|
@ -3,6 +3,8 @@ import gzip
|
|||
from io import StringIO
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from flask import current_app
|
||||
|
||||
from aerofiles.seeyou import Reader
|
||||
from ogn.parser.utils import FEETS_TO_METER
|
||||
import requests
|
||||
|
@ -118,7 +120,7 @@ def get_airports(cupfile):
|
|||
|
||||
airports.append(airport)
|
||||
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
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue