# 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)))