This commit is contained in:
hibiki
2021-06-23 15:57:03 +08:00
parent 862776b011
commit f84896213a
17 changed files with 400 additions and 149 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ db = Gino()
async def init():
i_bind = DATABASE_URI if DATABASE_URI else bind
if not bind:
if not i_bind:
i_bind = f"{sql_name}://{user}:{password}@{address}:{port}/{database}"
# print(i_bind)
try:
+3 -3
View File
@@ -1,7 +1,7 @@
import logging
from datetime import datetime
from configs.path_config import LOG_PATH
import sys
# CRITICAL 50
# ERROR 40
# WARNING 30
@@ -17,8 +17,8 @@ logger = logging.getLogger('hibiki')
logger.setLevel(level=logging.DEBUG)
formatter = logging.Formatter('[%(asctime)s] - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s')
# print(LOG_PATH)
file_handler = logging.FileHandler(LOG_PATH + str((datetime.now()).date()) + '.log', mode='a', encoding='utf-8')
file_handler = logging.FileHandler(LOG_PATH + str(datetime.now().date()) + '.log', mode='a', encoding='utf-8')
file_handler.setLevel(level=logging.INFO)
file_handler.setFormatter(formatter)
+4 -8
View File
@@ -1,13 +1,9 @@
import os
DATABASE_URI = os.environ.get('DATABASE_URI')
try:
DATABASE_URI = os.environ['DATABASE_URI']
except KeyError:
DATABASE_URI = ''
TL_M_KEY = os.environ.get('TL_KEY')
SYSTEM_PROXY = os.environ.get('SYSTEM_PROXY')
try:
TL_M_KEY = os.environ['TL_KEY']
except KeyError:
TL_M_KEY = []