Revize 1bdc90c0
Přidáno uživatelem David Friesecký před téměř 4 roky(ů)
src/config/configuration.py | ||
---|---|---|
5 | 5 |
from injector import singleton |
6 | 6 |
|
7 | 7 |
from src.constants import DEFAULT_CONNECTION_STRING, TEST_DATABASE_FILE, DEFAULT_SERVER_BASE_URL |
8 |
from src.constants import LOG_FILE_LOCATION, LOG_FORMAT |
|
8 | 9 |
|
9 | 10 |
DATABASE_SECTION = "Database" |
10 | 11 |
DATABASE_CONNECTION_STRING = "ConnectionString" |
... | ... | |
12 | 13 |
SERVER_SECTION = "Server" |
13 | 14 |
SERVER_BASE_URL = "ServerBaseURL" |
14 | 15 |
|
15 |
LOG_FILE = "application.log" |
|
16 |
LOG_FORMAT = "%(levelname)-8s %(asctime)s - %(message)s" |
|
17 |
|
|
18 | 16 |
|
19 | 17 |
class Configuration: |
20 | 18 |
""" |
... | ... | |
68 | 66 |
binder.bind(Configuration, to=app_configuration, scope=singleton) |
69 | 67 |
|
70 | 68 |
|
71 |
def configure_logging(self):
|
|
72 |
logging.basicConfig(filename=LOG_FILE, |
|
69 |
def configure_logging(): |
|
70 |
logging.basicConfig(filename=LOG_FILE_LOCATION.shortest_relative_path(),
|
|
73 | 71 |
filemode='a+', |
74 | 72 |
format=LOG_FORMAT, |
75 | 73 |
level=logging.DEBUG) |
Také k dispozici: Unified diff
Re #8570 - Setted configuration of logging