Skip to content

Commit

Permalink
maybe fix #1195 more log fields by default
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva committed Aug 28, 2024
1 parent f7563bc commit f770216
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion sarracenia/flowcb/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,16 @@ def _messageAcceptStr(self,msg):
s+= f"a file with baseUrl: {msg['baseUrl']} "
if 'relPath' in msg:
s+= f"relPath: {msg['relPath']} "
if 'sundew_extension' in msg:
s+=f"sundew_extension: {msg['sundew_extension']} "
if 'retrievePath' in msg:
s+= f"retrievePath: {msg['retrievePath']} "
if 'rename' in msg:
s+= f"rename: {msg['rename']} "
if 'identity' in msg and 'value' in msg['identity']:
s+=f"id: {msg['identity']['value'][0:7]} "
if 'size' in msg:
s+=f"size: {msg['size']} "
return s

def _messagePostStr(self,msg):
Expand Down Expand Up @@ -132,6 +138,11 @@ def _messagePostStr(self,msg):
s+= f"retrievePath: {msg['retrievePath']} "
if 'rename' in msg:
s+= f"rename: {msg['rename']} "
if 'size' in msg:
s+=f"size: {msg['size']} "
if 'identity' in msg and 'value' in msg['identity']:
s+=f"id: {msg['identity']['value'][0:7]} "

return s

def after_accept(self, worklist):
Expand All @@ -156,7 +167,7 @@ def after_accept(self, worklist):
if lag > self.lagMax:
self.lagMax = lag
if set(['after_accept']) & self.o.logEvents:
logger.info( f"accepted: (lag: {lag:.2f} ) {self._messageStr(msg)}" )
logger.info( f"accepted: (lag: {lag:.2f} ) {self._messageAcceptStr(msg)}" )

def after_post(self, worklist):
if set(['after_post']) & self.o.logEvents:
Expand Down

0 comments on commit f770216

Please sign in to comment.