TableOrder/app.py

28 lines
843 B
Python
Raw Permalink Normal View History

2025-07-04 14:38:36 +02:00
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'])
2025-07-05 10:13:28 +02:00
app.run(debug=False)
2025-07-04 14:38:36 +02:00
if __name__ == "__main__":
#First startup is handled in DB/handler
run()