added code to initialize db with models and recodres
This commit is contained in:
@@ -5,6 +5,7 @@ Backend base module
|
||||
import logging
|
||||
from io import StringIO
|
||||
from logging.config import dictConfig
|
||||
from logging.handlers import MemoryHandler
|
||||
from typing import Union
|
||||
|
||||
import coloredlogs as coloredlogs
|
||||
@@ -28,6 +29,8 @@ __email__ = "it@t-kurze.de"
|
||||
# __status__ = "Production"
|
||||
__status__ = "Development"
|
||||
|
||||
from .tools.send_mail import get_smtp_default_handler
|
||||
|
||||
dictConfig({
|
||||
'version': 1,
|
||||
'formatters': {
|
||||
@@ -82,6 +85,9 @@ dictConfig({
|
||||
main_logger = logging.getLogger("lrc")
|
||||
|
||||
# following might be dangerous, as buffer might be filled without a mechanism to empty it
|
||||
smtp_error_handler = get_smtp_default_handler(subject="Warnings, errors and worse...!")
|
||||
mem_handler = MemoryHandler(capacity=10, flushLevel=logging.ERROR, target=smtp_error_handler)
|
||||
mem_handler.setLevel(logging.WARNING)
|
||||
# error_log_stream = StringIO()
|
||||
# error_log_stream_handler = logging.StreamHandler(stream=error_log_stream)
|
||||
# error_log_stream_handler.setLevel(logging.ERROR)
|
||||
|
||||
Reference in New Issue
Block a user