Commit ce5afcee authored by Marco Mariani's avatar Marco Mariani

moved logging config before setRunning

parent 4abaf2a6
...@@ -378,27 +378,30 @@ def main(): ...@@ -378,27 +378,30 @@ def main():
key_file_dict[cert] = (temp_key, temp_cert) key_file_dict[cert] = (temp_key, temp_cert)
return temp_key.name, temp_cert.name return temp_key.name, temp_cert.name
args = parser.parse_args() args = parser.parse_args()
log = args.log
formatter = logging.Formatter('%(asctime)s %(message)s')
logger = logging.getLogger()
if args.verbose:
log_level = logging.DEBUG
else:
log_level = logging.INFO
logger.setLevel(log_level)
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(formatter)
logger.addHandler(handler)
if log:
handler = logging.FileHandler(log)
handler.setFormatter(formatter)
logger.addHandler(handler)
log_file = open(log)
log_file.seek(0, 2)
pidfile = args.pidfile pidfile = args.pidfile
if pidfile: if pidfile:
setRunning(pidfile) setRunning(pidfile)
try: try:
log = args.log
formatter = logging.Formatter('%(asctime)s %(message)s')
logger = logging.getLogger()
if args.verbose:
log_level = logging.DEBUG
else:
log_level = logging.INFO
logger.setLevel(log_level)
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(formatter)
logger.addHandler(handler)
if log:
handler = logging.FileHandler(log)
handler.setFormatter(formatter)
logger.addHandler(handler)
log_file = open(log)
log_file.seek(0, 2)
section_dict = {} section_dict = {}
configuration = ConfigParser.SafeConfigParser() configuration = ConfigParser.SafeConfigParser()
configuration.readfp(args.configuration_file) configuration.readfp(args.configuration_file)
......
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