Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 688c63b7

Přidáno uživatelem Jan Pašek před téměř 4 roky(ů)

Re #8707 - Logging of used config file improved

Zobrazit rozdíly:

app.py
100 100
    config = injector.get(Configuration)
101 101
    configuration.configure_logging(config)
102 102

  
103
    Logger.info(f"Using configuration file: {config.config_file}")
104

  
103 105
    # There's a little dependency on the CryptoService, which is not a pretty thing from
104 106
    # architectural point of view. However it is only a minimal piece of code and
105 107
    # it makes sense to do it in this way instead of trying to run openssl via subprocess here
src/config/configuration.py
38 38
        Constructor
39 39
        It must initialize all variables to their default values
40 40
        """
41
        self.config_file = None
41 42
        self.connection_string = DEFAULT_CONNECTION_STRING
42 43
        self.base_server_url = DEFAULT_SERVER_BASE_URL
43 44
        self.log_level = DEFAULT_LOG_LEVEL
......
65 66
    app_configuration = Configuration()
66 67
    # if configuration file is not specified use the default configuration
67 68
    if config_file is not None and os.path.exists(config_file):
69
        app_configuration.config_file = config_file
68 70
        config = configparser.ConfigParser()
69 71
        config.read(config_file)
70 72

  
......
77 79
            app_configuration.base_server_url = server_config.get(SERVER_BASE_URL,
78 80
                                                                  DEFAULT_SERVER_BASE_URL)
79 81
            app_configuration.log_level = server_config.get(SERVER_LOG_LEVEL, DEFAULT_LOG_LEVEL)
82

  
80 83
    binder.bind(Configuration, to=app_configuration, scope=singleton)
81 84

  
82 85

  

Také k dispozici: Unified diff