title: python-daemon does not do anything
body: <p>I want to use the pip package python-daemon to daemonize one of my tasks, but I can't get it to run even with the most simple example I can think of.</p>
  
  <p>The following code snipplet displays "Hallo" und logs the "Before with statement", but doesn't do anything else.</p>
  
  <p>The pid-File for the daemon will be created and deleted and the job lasts longer if you put in some time.sleep() inside, but it doesn't log anything.
  The "After with.." also never shows up in the log.</p>
  
  <p>Can someone point out what I'm doing wrong here?</p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>#!/usr/bin/python3
  
  # pip3 install python-daemon
  import daemon
  import lockfile
  import logging
  
  
  LOG_FORMAT = "%(levelname)s %(asctime)s - %(message)s"
  logging.basicConfig(filename="/tmp/test.log",
                      level=logging.DEBUG,
                      format=LOG_FORMAT)
  logger = logging.getLogger()
  
  context = daemon.DaemonContext(working_directory='/tmp/',
                                 pidfile=lockfile.FileLock('/tmp   /test.pid'),
                                 )
  
  logger.info("Before with statement")
  print("Hallo")
  
  with context:
      logger.info("Info")
  
  logger.info("After with statement")
  </code></pre>