#NEWLINE# def daemonize( command , name , pidfile , logger , **kwargs ) : #NEWLINE# #INDENT# 'Daemonizes the `command` function.\n    \n    Uses `name` for syslogging, `pidfile` for the pid file, and logs messages\n    to `logger` or a child logger of logger as appropriate.\n    ' #NEWLINE# if ( not HAS_DAEMONIZE ) : #NEWLINE# #INDENT# raise Exception ( 'Need `daemonize` to run as daemon' ) #NEWLINE# #UNINDENT# _using_pidfile ( pidfile , logger ) #NEWLINE# daemon = Daemonize ( app = name , pid = pidfile , action = command , logger = logging . getLogger ( ( logger . name + '.daemon' ) ) , ** kwargs ) #NEWLINE# daemon . start ( )