
Change the client to use Pod IP instead of host alias to talk to notification services Refactor client according to Single Responsibility Principle: 1,extract broker state management logic from daemon module to broker_state_manager 2,extract broker connection management logic from daemon module to broker_connection_manager 3,extract notification handling logic from daemon module to notification_handler 4,move NotificationWorker from daemon module to notification_worker module 5,change broker endpoint from host alias to IP which removes dependency to /etc/hosts 6,add logic to re-setup the broker connection in case of notificationservice pod IP changes Partial-Bug: 1924198 Signed-off-by: Bin Yang <bin.yang@windriver.com> Change-Id: Ifc9a16912f5ccebe0426a0d4e72c0f13dcbabcd7
22 lines
443 B
Python
22 lines
443 B
Python
#
|
|
# Copyright (c) 2021 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
import os
|
|
import logging
|
|
|
|
LOGGING_LEVEL = os.environ.get("LOGGING_LEVEL", "INFO")
|
|
|
|
def get_logger(module_name):
|
|
logger = logging.getLogger(module_name)
|
|
return config_logger(logger)
|
|
|
|
def config_logger(logger):
|
|
'''
|
|
configure the logger: uncomment following lines for debugging
|
|
'''
|
|
logger.setLevel(LOGGING_LEVEL)
|
|
return logger
|