Refactor and enhance the laborious workflow and utilities - Removed outdated test file `test_predictions_batch.py` from workflows. - Added `input_sample.json` for standardized input configuration. - Introduced `connectors_config.py` to manage database and service configurations. - Implemented a logging utility in `logger.py` for consistent logging across the application. - Created `policies.py` to define retry policies for workflows. - Developed comprehensive tests for `MLFlowRepository` in `test_model_repository.py`. - Added extensive tests for `OpcRepository` in `test_opc_repository.py`. - Updated `test_predictions_batch.py` to reflect new workflow structure and testing methodology.
23 lines
494 B
Python
23 lines
494 B
Python
from os import getenv
|
|
import logging
|
|
import sys
|
|
|
|
|
|
def get_logger(name: str):
|
|
log_level = getenv('LOG_LEVEL', 'INFO').upper()
|
|
|
|
logger = logging.getLogger(name)
|
|
logger.setLevel(log_level)
|
|
stream_handler = logging.StreamHandler(sys.stdout)
|
|
stream_handler.setLevel(log_level)
|
|
|
|
stream_handler.setFormatter(
|
|
logging.Formatter(
|
|
'%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
|
)
|
|
)
|
|
|
|
logger.addHandler(stream_handler)
|
|
|
|
return logger
|