Update logger config
[pti/o2.git] / o2ims / adapter / redis_eventpublisher.py
index 835c72c..4df167e 100644 (file)
 #  limitations under the License.
 
 import json
-import logging
 from dataclasses import asdict
 import redis
 
 from o2ims import config
 from o2ims.domain import events
 
-logger = logging.getLogger(__name__)
+from o2common.helper import o2logging
+logger = o2logging.get_logger(__name__)
+
 
 r = redis.Redis(**config.get_redis_host_and_port())
 
 
 def publish(channel, event: events.Event):
-    logging.info("publishing: channel=%s, event=%s", channel, event)
+    logger.info("publishing: channel=%s, event=%s", channel, event)
     r.publish(channel, json.dumps(asdict(event)))