added logging conf and now checking recording status with simple script ; notifications are missing
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
"""
|
||||
Backend base module
|
||||
"""
|
||||
|
||||
import logging
|
||||
from logging.config import dictConfig
|
||||
import coloredlogs as coloredlogs
|
||||
import jwt
|
||||
import requests
|
||||
from flask import Flask, jsonify
|
||||
@@ -11,6 +13,72 @@ from flask_jwt_extended import JWTManager, decode_token
|
||||
from flask_login import LoginManager
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_cors import CORS
|
||||
from backend.config import Config
|
||||
|
||||
__author__ = "Tobias Kurze"
|
||||
__copyright__ = "Copyright 2019, Tobias Kurze, KIT"
|
||||
__credits__ = ["Tobias Kurze"]
|
||||
__license__ = ""
|
||||
__version__ = "0.9.0"
|
||||
__maintainer__ = "Tobias Kurze"
|
||||
__email__ = "it@t-kurze.de"
|
||||
# __status__ = "Production"
|
||||
__status__ = "Development"
|
||||
|
||||
|
||||
dictConfig({
|
||||
'version': 1,
|
||||
'formatters': {
|
||||
'default': {
|
||||
'format': '[%(asctime)s] {%(threadName)s} %(levelname)s in %(module)s, line %(lineno)d: %(message)s',
|
||||
}
|
||||
},
|
||||
'handlers': {
|
||||
'wsgi': {
|
||||
'class': 'logging.StreamHandler',
|
||||
'stream': 'ext://flask.logging.wsgi_errors_stream',
|
||||
'formatter': 'default'
|
||||
},
|
||||
'root_file': {
|
||||
'class': 'logging.handlers.TimedRotatingFileHandler',
|
||||
'filename': Config.ROOT_LOG_FILE,
|
||||
'when': 'd',
|
||||
'interval': 1,
|
||||
'backupCount': 3,
|
||||
'formatter': 'default',
|
||||
},
|
||||
'file': {
|
||||
'class': 'logging.handlers.TimedRotatingFileHandler',
|
||||
'filename': Config.LOG_FILE,
|
||||
'when': 'd',
|
||||
'interval': 1,
|
||||
'backupCount': 5,
|
||||
'formatter': 'default',
|
||||
},
|
||||
'errors_file': {
|
||||
'class': 'logging.handlers.TimedRotatingFileHandler',
|
||||
'filename': Config.ERROR_LOG_FILE,
|
||||
'when': 'd',
|
||||
'interval': 1,
|
||||
'backupCount': 5,
|
||||
'level': 'ERROR',
|
||||
'formatter': 'default',
|
||||
},
|
||||
},
|
||||
'loggers': {
|
||||
'mal': {
|
||||
'level': Config.LOG_LEVEL,
|
||||
'handlers': ['wsgi', 'file', 'errors_file']
|
||||
}
|
||||
},
|
||||
'root': {
|
||||
'level': 'ERROR',
|
||||
'handlers': ['root_file', 'errors_file']
|
||||
}
|
||||
})
|
||||
|
||||
main_logger = logging.getLogger("lrc")
|
||||
coloredlogs.install(level='DEBUG', logger=main_logger)
|
||||
|
||||
|
||||
class LrcException(Exception):
|
||||
|
||||
Reference in New Issue
Block a user