# pip instal ws4py # # Powershell to extract CSV perf data from logs: # ``` # (((((get-content stratux_hud.log) -replace "^.* - INFO - ", "") -replace "\<.*?\..*?\.", "") -replace " object.*\>", "") -replace "---.*-", "") | Where {$_ -ne ""} # ``` import logging import logging.handlers import heads_up_display from lib.logger import Logger python_logger = logging.getLogger("stratux_hud") python_logger.setLevel(logging.DEBUG) LOGGER = Logger(python_logger) HANDLER = logging.handlers.RotatingFileHandler("stratux_hud.log", maxBytes=1048576, backupCount=10) HANDLER.setFormatter( logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')) python_logger.addHandler(HANDLER) if __name__ == '__main__': LOGGER.log_info_message("Starting HUD") LOGGER.log_info_message( "System, DateTime, Component, Instantaneous, Rolling Mean, Max") hud = heads_up_display.HeadsUpDisplay(LOGGER) hud.run()
LOGGER.log_info_message("Waiting on " + airport) break except: LOGGER.log_warning_message("Error while waiting for boot") finally: thread_lock_object.release() time.sleep(0.5) return True if __name__ == '__main__': # Start loading the METARs in the background # while going through the self-test LOGGER.log_info_message("Initialize weather for all airports") refresh_task = RecurringTask('Refresh', 0, refresh_thread, None, True) # Test LEDS on startup colors_to_init = ( weather.LOW, weather.RED, weather.BLUE, weather.GREEN, weather.YELLOW, weather.WHITE, weather.GRAY, weather.OFF ) for color in colors_to_init: