Commit 0de8b9b8 authored by Ilya A. Otyutskiy's avatar Ilya A. Otyutskiy

New version: 1.3.

- Create log directory if not exists.
parent c56a2d3a
......@@ -84,11 +84,16 @@ def start(fun_to_start, pid, logfile=None, debug=False):
# Set custom action on SIGTERM.
signal.signal(signal.SIGTERM, partial(sigterm, pid))
# Initializing logger.
# Choose log level.
if debug:
loglevel = logging.DEBUG
else:
loglevel = logging.INFO
# Create log directory if not exists.
logdir = "/".join(logfile.split("/")[:-1])
if not os.path.exists(logdir):
os.makedirs(logdir)
# Initialize logger.
logging.basicConfig(format="%(asctime)s %(levelname)s %(message)s", \
datefmt="%b %d %H:%M:%S", level=loglevel, \
filename=logfile)
......
......@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
setup(
name = "daemonize",
version = "1.2",
version = "1.3",
py_modules = ['daemonize'],
author = "Ilya A. Otyutskiy",
author_email = "sharp@thesharp.ru",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment