Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 535ce081

Přidáno uživatelem David Friesecký před téměř 4 roky(ů)

Re #8570 - Logged configuration

Zobrazit rozdíly:

src/config/configuration.py
6 6

  
7 7
from src.constants import DEFAULT_CONNECTION_STRING, TEST_DATABASE_FILE, DEFAULT_SERVER_BASE_URL
8 8
from src.constants import LOG_FILE_LOCATION, LOG_FORMAT
9
from src.utils.logger import Logger
9 10

  
10 11
DATABASE_SECTION = "Database"
11 12
DATABASE_CONNECTION_STRING = "ConnectionString"
......
46 47
    :param binder: injector configuration binder instance
47 48
    :return: N/A
48 49
    """
49
    # TODO log which configuration is going to be used
50
    config_file = os.environ.get("X509_CONFIG")
50
    # TODO check: log which configuration is going to be used
51
    config_name = "X509_CONFIG"
52
    Logger.info(f"Using configuration '{config_name}'")
53
    config_file = os.environ.get(config_name)
51 54
    app_configuration = Configuration()
52 55
    # if configuration file is not specified use the default configuration
53 56
    if config_file is not None and os.path.exists(config_file):
src/exceptions/database_exception.py
1 1
class DatabaseException(Exception):
2
    pass
2
    def __init__(self, message):
3
        self.message = message
4

  
5
    def __str__(self):
6
        return self.message

Také k dispozici: Unified diff