fixxed logging NameError
This commit is contained in:
parent
174e64e480
commit
22e6071240
@ -4,8 +4,10 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
from logging.handlers import TimedRotatingFileHandler
|
from logging.handlers import TimedRotatingFileHandler
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
from config import Config
|
||||||
|
|
||||||
LOG_DIR = app.config['LOG_DIR']
|
#LOG_DIR = app.config['LOG_DIR']
|
||||||
|
LOG_DIR = Config.LOG_DIR
|
||||||
os.makedirs(LOG_DIR, exist_ok=True)
|
os.makedirs(LOG_DIR, exist_ok=True)
|
||||||
|
|
||||||
def cleanup_old_log_dirs(max_age_days=90):
|
def cleanup_old_log_dirs(max_age_days=90):
|
||||||
|
|||||||
@ -3,6 +3,6 @@ import os
|
|||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
SECRET_KEY = os.environ.get('SECRET_KEY') or 'dev-key-change-me'
|
SECRET_KEY = os.environ.get('SECRET_KEY') or 'dev-key-change-me'
|
||||||
CONFIG_DIR = 'configs'
|
CONFIG_DIR = os.path.join(os.path.dirname(__file__), '..', 'configs')
|
||||||
LOG_DIR = 'logs'
|
LOG_DIR = os.path.join(os.path.dirname(__file__), '..', 'logs')
|
||||||
SOUNDS_DIR = 'sounds'
|
SOUNDS_DIR = os.path.join(os.path.dirname(__file__), '..', 'sounds')
|
||||||
Loading…
x
Reference in New Issue
Block a user