updated logging format

parent ee00ede0
...@@ -59,7 +59,7 @@ class OverlayNode(Node): ...@@ -59,7 +59,7 @@ class OverlayNode(Node):
# Todo something is wrong here not getting correct votes back # Todo something is wrong here not getting correct votes back
votes = Utility.verifySort(pk, sorthash, proof, seed, tou, role, self.network.pk_weight_map.get(pk), self.network.badaW) votes = Utility.verifySort(pk, sorthash, proof, seed, tou, role, self.network.pk_weight_map.get(pk), self.network.badaW)
if votes : if votes :
self.logger.info("THese are valid committee votes with votes : ",votes) self.logger.info("THese are valid committee votes with votes : "+str(votes))
print("why votes be zero :",role) print("why votes be zero :",role)
print(votes,"\t",value,"\t",sorthash) print(votes,"\t",value,"\t",sorthash)
return votes,value,sorthash return votes,value,sorthash
...@@ -67,6 +67,8 @@ class OverlayNode(Node): ...@@ -67,6 +67,8 @@ class OverlayNode(Node):
def partOfCountVotes(self,round,step,start,counts,voters,T,tou): def partOfCountVotes(self,round,step,start,counts,voters,T,tou):
msgs = self.uniqueReceivedMessages.pop(Config.COMMITTEE_VOTE_MSG_type) msgs = self.uniqueReceivedMessages.pop(Config.COMMITTEE_VOTE_MSG_type)
print("-------------msgs , ", self.id)
print(msgs)
for msg in msgs: for msg in msgs:
msg_round = msg[1][1][0] msg_round = msg[1][1][0]
...@@ -81,6 +83,8 @@ class OverlayNode(Node): ...@@ -81,6 +83,8 @@ class OverlayNode(Node):
continue continue
voters.append(msg_pk) voters.append(msg_pk)
counts[value] = counts[value]+ votes counts[value] = counts[value]+ votes
print('--------------counts-------------',self.id)
print(counts)
if counts[value] > T*tou : if counts[value] > T*tou :
print("returning value") print("returning value")
return value return value
......
...@@ -4,7 +4,9 @@ from TestCases import populateTodolist ...@@ -4,7 +4,9 @@ from TestCases import populateTodolist
import logging import logging
logging.basicConfig(filename='ASim.log', level=logging.INFO) # logging.basicConfig(filename='ASim.log', level=logging.INFO)
# logging.basicConfig(filename='ASim.log', format="%(funcName)s():%(lineno)i: %(message)s")
logging.basicConfig(filename='ASim.log',level=logging.INFO, format="%(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s")
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment