mirror of
https://github.com/mewtek/i2ME-Legacy.git
synced 2025-06-10 05:30:00 -05:00
Use logging and coloredlogs instead of printing
This commit is contained in:
14
main.py
14
main.py
@ -1,19 +1,25 @@
|
||||
import asyncio
|
||||
# from re import A
|
||||
import logging,coloredlogs
|
||||
from recordGenerators import DailyForecast,CurrentObservations,HourlyForecast,AirQuality,AirportDelays,PollenForecast,Breathing
|
||||
|
||||
|
||||
l = logging.getLogger(__name__)
|
||||
coloredlogs.install(logger=l)
|
||||
|
||||
|
||||
"""
|
||||
CurrentConditions: Every 5 minutes
|
||||
Daily Forecasts, Hourlies, etc: 60 minutes
|
||||
Alerts: 5 minutes
|
||||
"""
|
||||
l.info("Starting i2RecordCollector")
|
||||
l.info("Developed by mewtek32, Floppaa, and Goldblaze")
|
||||
|
||||
print("i2MessageEncoder-Python\nDeveloped by mewtek\nData record generators by Floppaa & Goldblaze")
|
||||
|
||||
async def FiveMinUpdaters():
|
||||
while True:
|
||||
CurrentObservations.makeDataFile()
|
||||
print("Sleeping for 5 minutes...")
|
||||
l.debug("Sleeping for 5 minutes...")
|
||||
await asyncio.sleep(300)
|
||||
|
||||
|
||||
@ -25,7 +31,7 @@ async def HourUpdaters():
|
||||
PollenForecast.makeDataFile()
|
||||
AirportDelays.writeData()
|
||||
Breathing.makeDataFile()
|
||||
print("Sleeping for an hour...")
|
||||
l.debug("Sleeping for an hour...")
|
||||
await asyncio.sleep(3600)
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
Reference in New Issue
Block a user