[VOL-2311] Cleaning up logs
Change-Id: Ib40f1a9e37f10f1a6e6c7d46665e1b82a3fdde1b
diff --git a/VERSION b/VERSION
index 32d1656..2bf1c1c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.3.1-dev
+2.3.1
diff --git a/pyvoltha/adapters/extensions/events/adapter_events.py b/pyvoltha/adapters/extensions/events/adapter_events.py
index c7e80d2..9b19c5c 100644
--- a/pyvoltha/adapters/extensions/events/adapter_events.py
+++ b/pyvoltha/adapters/extensions/events/adapter_events.py
@@ -112,7 +112,7 @@
except Exception as e:
self.log.exception('failed-to-send-event', e=e)
raise
- log.debug('event-sent-to-kafka', event_header=event_header, event_body=event_body)
+ log.debug('event-sent-to-kafka', event_type=event_header.type)
diff --git a/pyvoltha/adapters/extensions/omci/omci_cc.py b/pyvoltha/adapters/extensions/omci/omci_cc.py
index f689cd0..1246ac5 100644
--- a/pyvoltha/adapters/extensions/omci/omci_cc.py
+++ b/pyvoltha/adapters/extensions/omci/omci_cc.py
@@ -337,15 +337,15 @@
try:
rx_frame = msg if isinstance(msg, OmciFrame) else OmciFrame(msg)
-
+ self.log.debug('omci-frame-decoded', omci_msg=hexlify(msg))
except KeyError as e:
# Unknown, Unsupported, or vendor-specific ME. Key is the unknown classID
- self.log.debug('frame-decode-key-error', msg=hexlify(msg), e=e)
+ self.log.debug('frame-decode-key-error', omci_msg=hexlify(msg), e=e)
rx_frame = self._decode_unknown_me(msg)
self._rx_unknown_me += 1
except Exception as e:
- self.log.exception('frame-decode', msg=hexlify(msg), e=e)
+ self.log.exception('frame-decode', omci_msg=hexlify(msg), e=e)
return
finally:
diff --git a/pyvoltha/adapters/iadapter.py b/pyvoltha/adapters/iadapter.py
index 21a2404..6b8c66c 100644
--- a/pyvoltha/adapters/iadapter.py
+++ b/pyvoltha/adapters/iadapter.py
@@ -171,7 +171,7 @@
raise NotImplementedError()
def update_flows_bulk(self, device, flows, groups):
- log.info('bulk-flow-update', device_id=device.id,
+ log.debug('bulk-flow-update', device_id=device.id,
flows=flows, groups=groups)
assert len(groups.items) == 0
reactor.callLater(0, self.devices_handlers[device.id].update_flow_table,
diff --git a/pyvoltha/adapters/kafka/adapter_proxy.py b/pyvoltha/adapters/kafka/adapter_proxy.py
index cc69a28..591c1c3 100644
--- a/pyvoltha/adapters/kafka/adapter_proxy.py
+++ b/pyvoltha/adapters/kafka/adapter_proxy.py
@@ -102,7 +102,8 @@
iaMsg.header.CopyFrom(h)
iaMsg.body.Pack(msg)
- log.debug("sending-inter-adapter-message", header=iaMsg.header)
+ log.debug("sending-inter-adapter-message", type=iaMsg.header.type, from_topic=iaMsg.header.from_topic,
+ to_topic=iaMsg.header.to_topic, to_device_id=iaMsg.header.to_device_id)
res = yield self.invoke(rpc="process_inter_adapter_message",
to_topic=iaMsg.header.to_topic,
msg=iaMsg)
diff --git a/pyvoltha/adapters/kafka/container_proxy.py b/pyvoltha/adapters/kafka/container_proxy.py
index 8b622d0..4e2fa12 100644
--- a/pyvoltha/adapters/kafka/container_proxy.py
+++ b/pyvoltha/adapters/kafka/container_proxy.py
@@ -61,15 +61,14 @@
try:
(success, d) = yield func(*args, **kw)
if success:
- log.debug("successful-response", func=func, val=d)
+ log.debug("successful-response", func=func)
if return_cls is not None:
rc = return_cls()
if d is not None:
d.Unpack(rc)
returnValue(rc)
else:
- log.debug("successful-response-none", func=func,
- val=None)
+ log.debug("successful-response-none", func=func)
returnValue(None)
else:
log.warn("unsuccessful-request", func=func, args=args,
diff --git a/pyvoltha/adapters/kafka/kafka_inter_container_library.py b/pyvoltha/adapters/kafka/kafka_inter_container_library.py
index f6d76f0..2b32c24 100644
--- a/pyvoltha/adapters/kafka/kafka_inter_container_library.py
+++ b/pyvoltha/adapters/kafka/kafka_inter_container_library.py
@@ -397,7 +397,8 @@
else:
log.debug("unsupported-msg", msg_type=type(message.body))
return None
- log.debug("parsed-response", input=message, output=resp)
+ log.debug("parsed-response", type=message.header.type, from_topic=message.header.from_topic,
+ to_topic=message.header.to_topic)
return resp
except Exception as e:
log.exception("parsing-response-failed", msg=msg, e=e)
@@ -466,14 +467,15 @@
augmented_args = _augment_args_with_FromTopic(msg_body.args,
msg_body.reply_to_topic)
if augmented_args:
- log.debug("message-body-args-present", body=msg_body)
+ log.debug("message-body-args-present", rpc=msg_body.rpc,
+ response_required=msg_body.response_required, reply_to_topic=msg_body.reply_to_topic)
(status, res) = yield getattr(
self.topic_target_cls_map[targetted_topic],
self._to_string(msg_body.rpc))(
**_toDict(augmented_args))
else:
- log.debug("message-body-args-absent", body=msg_body,
- rpc=msg_body.rpc)
+ log.debug("message-body-args-absent", rpc=msg_body.rpc,
+ response_required=msg_body.response_required, reply_to_topic=msg_body.reply_to_topic,)
(status, res) = yield getattr(
self.topic_target_cls_map[targetted_topic],
self._to_string(msg_body.rpc))()
@@ -488,7 +490,7 @@
response.header.to_topic)
self._send_kafka_message(res_topic, response)
- log.debug("Response-sent", response=response.body,
+ log.debug("Response-sent",
to_topic=res_topic)
elif message.header.type == MessageType.Value("RESPONSE"):
trns_id = self._to_string(message.header.id)
@@ -554,10 +556,10 @@
self.transaction_id_deferred_map[
self._to_string(request.header.id)] = wait_for_result
log.debug("message-send", transaction_id=transaction_id, to_topic=to_topic,
- from_topic=reply_topic, kafka_request=request)
+ from_topic=reply_topic)
yield self._send_kafka_message(to_topic, request)
log.debug("message-sent", transaction_id=transaction_id, to_topic=to_topic,
- from_topic=reply_topic, kafka_request=request)
+ from_topic=reply_topic)
if response_required:
res = yield wait_for_result
@@ -567,7 +569,7 @@
if res is not None:
if res.success:
- log.debug("send-message-response", rpc=rpc, result=res)
+ log.debug("send-message-response", rpc=rpc)
if callback:
callback((res.success, res.result))
else:
diff --git a/pyvoltha/common/structlog_setup.py b/pyvoltha/common/structlog_setup.py
index a5ce4a3..f0f9c87 100644
--- a/pyvoltha/common/structlog_setup.py
+++ b/pyvoltha/common/structlog_setup.py
@@ -80,7 +80,7 @@
# Configure standard logging
logging.config.dictConfig(log_config)
- logging.root.level -= 10 * verbosity_adjust
+ logging.root.level += 10 * verbosity_adjust
processors = [
add_exc_info_flag_for_exception,
@@ -96,7 +96,7 @@
# Mark first line of log
log = structlog.get_logger()
- log.info("first-line")
+ log.info("first-line", log_level=logging.root.level, verbosity_adjust=verbosity_adjust)
return log