mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2025-10-11 11:56:17 +00:00
Add documentation that covers: - configuration - prediction Add Python scripts that support automatic documentation generation for configuration data defined with pydantic. Adapt EOS configuration to provide more methods for REST API and automatic documentation generation. Adapt REST API to allow for EOS configuration file load and save. Sort REST API on generation of openapi markdown for docs. Move logutil to core/logging to allow configuration of logging by standard config. Make Akkudoktor predictions always start extraction of prediction data at start of day. Previously extraction started at actual hour. This is to support the code that assumes prediction data to start at start of day. Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
21 lines
566 B
Python
21 lines
566 B
Python
"""Abstract and base classes for logging."""
|
|
|
|
import logging
|
|
|
|
|
|
def logging_str_to_level(level_str: str) -> int:
|
|
"""Convert log level string to logging level."""
|
|
if level_str == "DEBUG":
|
|
level = logging.DEBUG
|
|
elif level_str == "INFO":
|
|
level = logging.INFO
|
|
elif level_str == "WARNING":
|
|
level = logging.WARNING
|
|
elif level_str == "CRITICAL":
|
|
level = logging.CRITICAL
|
|
elif level_str == "ERROR":
|
|
level = logging.ERROR
|
|
else:
|
|
raise ValueError(f"Unknown loggin level: {level_str}")
|
|
return level
|