code: def set_signal_handlers(self):
          '''Set some signal handlers.
  
          These react reasonably to shutdown requests, and keep the
          logging child alive.
  
          '''
          def handler(f):
              def wrapper(signum, backtrace):
                  return f()
              return wrapper
  
          self.old_sigabrt = signal.signal(signal.SIGABRT,
                                           handler(self.scram))
          self.old_sigint = signal.signal(signal.SIGINT,
                                          handler(self.stop_gracefully))
          self.old_sigpipe = signal.signal(signal.SIGPIPE,
                                           handler(self.live_log_child))
          signal.siginterrupt(signal.SIGPIPE, False)
          self.old_sigterm = signal.signal(signal.SIGTERM,
                                           handler(self.stop_gracefully)f set_signal_handlers(self):
          '''Set some signal handlers.
  
          These react reasonably to shutdown requests, and keep the
          logging child alive.
  
          '''
          def handler(f):
              def wrapper(signum, backtrace):
                  return f()
              return wrapper
  
          self.old_sigabrt = signal.signal(signal.SIGABRT,
                                           handler(self.scram))
          self.old_sigint = signal.signal(signal.SIGINT,
                                          handler(self.stop_gracefully))
          self.old_sigpipe = signal.signal(signal.SIGPIPE,
                                           handler(self.live_log_child))
          signal.siginterrupt(signal.SIGPIPE, False)
          self.old_sigterm = signal.signal(signal.SIGTERM,
                                           handler(self.stop_gracefully))
docs: Set some signal handlers.
  
          These react reasonably to shutdown requests, and keep the
          logging child alive.