The Config class is designed for reading configuration data from a file. It provides static methods to access specific configurations.
Returns the logger configuration from the configuration file.
Returns:
A dictionary containing the logger configuration parameters. Returns None if the logger configuration is not found.
Example:
logger_config = Config.logger()
if logger_config:
print(logger_config)
else:
print("Logger configuration not found.")
Returns the server configurations from the configuration file.
Returns:
A dictionary containing all server configurations. Returns None if the server configurations are not found.
Example:
servers_config = Config.servers()
if servers_config:
print(servers_config)
else:
print("Server configurations not found.")
Returns the server configuration for the specified server name from the configuration file.
Parameters:
name
(str): The name of the server configuration to retrieve.Returns:
A dictionary containing the server configuration parameters for the specified name. Returns None if the server configuration is not found.
Raises:
AttributeError
: If the server configuration for the given name is not found.
Example:
server_config = Config.server('MyServer')
if server_config:
print(server_config)
else:
print("Server configuration not found.")