From 83c5c9c847e20b94868cfd429bb939dacbc03a90 Mon Sep 17 00:00:00 2001 From: MarkusJoe Date: Wed, 16 Feb 2022 13:13:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E8=BE=93=E5=87=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E5=BC=8F=E6=9B=B4=E6=94=B9=E4=B8=BA=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index bf6b02c..a04231a 100644 --- a/app.py +++ b/app.py @@ -16,6 +16,7 @@ from gevent import pywsgi from bin.utils.b64img import re_sort_number_image from bin.utils.error import ErrorProcess from bin.utils.render_ import render_temp_ +from bin.utils.logger import logger from db.db import fetch_data app = Flask(__name__, static_url_path='') @@ -120,11 +121,11 @@ def index() -> Response: if __name__ == '__main__': - print('I: 服务器已在 http://127.0.0.1:5000 运行') + logger.info('服务器已在 http://127.0.0.1:5000 运行') try: server = pywsgi.WSGIServer(('0.0.0.0', 5000), app) server.serve_forever() except OSError: - print('E: 5000 端口被占用') + logger.error('5000 端口被占用') except KeyboardInterrupt: - print('I: 程序已退出') + logger.info('程序已退出')