Revize dbca269d
Přidáno uživatelem David Friesecký před asi 4 roky(ů)
src/config/configuration.py | ||
---|---|---|
1 | 1 |
import os |
2 | 2 |
|
3 | 3 |
import configparser |
4 |
import logging |
|
4 | 5 |
from injector import singleton |
5 | 6 |
|
6 | 7 |
from src.constants import DEFAULT_CONNECTION_STRING, TEST_DATABASE_FILE, DEFAULT_SERVER_BASE_URL |
... | ... | |
11 | 12 |
SERVER_SECTION = "Server" |
12 | 13 |
SERVER_BASE_URL = "ServerBaseURL" |
13 | 14 |
|
15 |
LOG_FILE = "application.log" |
|
16 |
LOG_FORMAT = "%(levelname)-8s %(asctime)s - %(message)s" |
|
17 |
|
|
14 | 18 |
|
15 | 19 |
class Configuration: |
16 | 20 |
""" |
... | ... | |
62 | 66 |
DEFAULT_SERVER_BASE_URL) |
63 | 67 |
|
64 | 68 |
binder.bind(Configuration, to=app_configuration, scope=singleton) |
69 |
|
|
70 |
|
|
71 |
def configure_logging(self): |
|
72 |
logging.basicConfig(filename=LOG_FILE, |
|
73 |
filemode='a+', |
|
74 |
format=LOG_FORMAT, |
|
75 |
level=logging.DEBUG) |
Také k dispozici: Unified diff
Re #8570 - Implemented logger
- implemented static functions (debug, info, warning, error, critical) (sorted by level)
- used configuration for setting logging library