https://github.com/bitaps-com/daemon
Python library daemon, asyncio terminal, logger
https://github.com/bitaps-com/daemon
Last synced: 11 months ago
JSON representation
Python library daemon, asyncio terminal, logger
- Host: GitHub
- URL: https://github.com/bitaps-com/daemon
- Owner: bitaps-com
- Created: 2017-06-07T12:53:08.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-12-28T15:09:19.000Z (over 4 years ago)
- Last Synced: 2025-04-19T11:56:43.192Z (about 1 year ago)
- Language: Python
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python daemonizer package
This is a Python module that will daemonize your Python script so it can continue running in the background. It works on Unix, Linux and OS X, creates a PID file and has standard commands (start, stop, virtual console), integrated logger.
# Usage
```import daemon
daemon.start()
...
rest code will be executed as daemon
```
# Command line arguments
### --terminal
If daemon not yet started, start daemon and forward all output to console.
CTRL+C stop console, but daemon continue working.
If daemon already started connect to dameon virtual console and forward output to console. All inputs from console forward to daemon process stdin.
### --xterminal
Same as --terminal but Start advanced vitual console.
### --stop
Terminate daemon.
# Integrated logger
```
...
logger = daemon.getLogger('test')
log.info('info message')
log.error('error message')
log.debug('debug message')
...
logger.setLevel(daemon.WARNING)
...
```