def SetLogPrefix(prefix):
 formatter = logging.Formatter((str(prefix) + ' [%(filename)s:%(lineno)d] %(levelname)s %(message)s'))
 logging._acquireLock()
 try:
  for handler in logging._handlerList:
   if isinstance(handler, weakref.ref):
    handler = handler()
   if handler:
    handler.setFormatter(formatter)
 finally:
  logging._releaseLock()

def SetLogPrefix ( prefix ) : formatter = logging . Formatter ( ( str ( prefix ) + ' [%(filename)s:%(lineno)d] %(levelname)s %(message)s' ) ) logging . _acquireLock ( ) try : for handler in logging . _handlerList : if isinstance ( handler , weakref . ref ) : handler = handler ( ) if handler : handler . setFormatter ( formatter ) finally : logging . _releaseLock ( )
adds a prefix to the log handler to identify the process .