old_contents: import sys
  
  class Logger(object):
  
      def info(self, msg, *args):
          sys.stdout.write("beandispenser info: " + msg.format(*args) + "\n")
          sys.stderr.flush()
  
      def error(self, msg, *args):
          sys.stderr.write("beandispenser error: " + msg.format(*args) + "\n")
          sys.stderr.flush()
  
new_contents: import sys, os
  
  class Logger(object):
  
      def info(self, msg, *args):
          sys.stdout.write("beandispenser (pid {}) info: {} \n".format(os.getpid(), msg.format(*args)))
          sys.stdout.flush()
  
      def error(self, msg, *args):
          sys.stdout.write("beandispenser (pid {}) error: {} \n".format(os.getpid(), msg.format(*args)))
          sys.stderr.flush()
  
subject: put pid in logs