
Adds notification functionality for PTP clockClass data and re-works the overall PTP sync status to allow for multiple ptp4l instances to be tracked. Each ptp4l instance reports its own sync status and clockClass. This change moves several static functions out of ptpsync.py and into the PtpMonitor class. The remaining static functions have been moved into utils.py This change retains backwards compatibility allowing for v1 PTP notifications and subscriptions to continue working while also providing the v2 functionality required by the ORAN Notification standard. This change also provides an override value for the logging level exposed via a helm chart override. Testing: PASS: GET and Subscribe functions for each notification type PASS: Multiple PTP instance support Story: 2010056 Task: 46038 Task: 46039 Signed-off-by: Cole Walker <cole.walker@windriver.com> Change-Id: Ic5456bc5a36f95186cdc6fe01ef1068b7124a5fc
21 lines
397 B
Python
21 lines
397 B
Python
#
|
|
# Copyright (c) 2021-2022 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
import logging
|
|
import sys
|
|
import os
|
|
|
|
|
|
def get_logger(module_name):
|
|
logger = logging.getLogger(module_name)
|
|
return config_logger(logger)
|
|
|
|
|
|
def config_logger(logger):
|
|
logging.basicConfig(stream=sys.stdout)
|
|
logger.setLevel(level=os.environ.get("LOGGING_LEVEL", "INFO"))
|
|
return logger
|