def do_something(logf):
    logger = logging.getLogger('eg_daemon')
logger.setLevel(logging.INFO)
fh = logging.FileHandler(logf)
fh.setLevel(logging.INFO)
formatstr = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
formatter = logging.Formatter(formatstr)
fh.setFormatter(formatter)
logger.addHandler(fh)
while True:
    logger.debug('this is a DEBUG message')
logger.info('this is an INFO message')
logger.error('this is an ERROR message')
How do I set up a daemon with python-daemon?