import sys from loguru import logger from Server.Host.flaskApp import app from Server.DB.querys import add import configparser config = configparser.ConfigParser() config.sections() config.read('Options.ini') ''' INFO if doing Asynchronous, Thread-safe, Multiprocess-safe All sinks added to the logger are thread-safe by default. They are not multiprocess-safe, but you can enqueue the messages to ensure logs integrity. This same argument can also be used if you want async logging. ''' @logger.catch def run(): #TODO: sys.stderr back to a file log?? logger.add(sys.stderr, format="{time} {level} {message}", filter="startup", level="INFO") logger.add(sys.stderr, backtrace=True, diagnose=config['OTHER']['log_diagnose']) app.run(debug=False) if __name__ == "__main__": #First startup is handled in DB/handler run()