import configparser
import os
#from .Logging.Logger import log, Severity

config = configparser.ConfigParser()
config.read('/etc/paedml-lis/config.ini')

def get_val(section:str, key:str):
    if not config.has_section(section):
        #log(f"Section '{section}' does not exist in the configuration file.", Severity.WTF)
        raise Exception(f"Section '{section}' does not exist in the configuration file.")
    if not config.has_option(section, key):
        #log(f"Key '{key}' does not exist in section '{section}' of the configuration file.", Severity.WTF)
        raise Exception(f"Key '{key}' does not exist in section '{section}' of the configuration file.")
    return config.get(section, key)