Commit 68d65ad4 authored by Daniel Scheffler's avatar Daniel Scheffler Committed by Mathias Peters
Browse files

Disabed Socket and FileHandler for job logfile.

parent 09c473be
......@@ -67,14 +67,14 @@ class GMS_logger(logging.Logger):
# set fileHandler for job logfile
joblog_Handler = None
# if False: # log_to_joblog:
if log_to_joblog:
if False: # log_to_joblog:
# if log_to_joblog:
job_logfile = os.path.join(CFG.path_job_logs, '%s.log' % CFG.ID)
# create output directory
silentmkdir(job_logfile)
if True: # CFG.CPUs > 1:
if False: # CFG.CPUs > 1:
# Logging messages from multiple workers to the same file in multiprocessing will cause
# PermissionErrors. Thats why use a SocketHandler in the middle which then logs to a FileHandler.
......@@ -173,6 +173,22 @@ class GMS_logger(logging.Logger):
# print(dir(self.streamHandler))
# self.streamHandler = None
# for handler in self.handlers[:]:
# from time import time
# t0=time()
# while True:
# try:
# # if handler.get_name()=='StringIO handler':
# # self.streamObj.flush()
# # self.streamHandler.flush()
# self.removeHandler(handler) # if not called with '[:]' the StreamHandlers are left open
# handler.flush()
# handler.close()
# except PermissionError:
# if time()-t0 < 5:
# pass
# else:
# warnings.warn('Could not properly close logfile due to a PermissionError: %s' % sys.exc_info()[1])
for handler in self.handlers[:]:
try:
# if handler.get_name()=='StringIO handler':
......
......@@ -461,9 +461,9 @@ class process_controller(object):
# RUN PREPROCESSING
from .pipeline import run_complete_preprocessing
from ..misc.logging import LogReceiver
with LogReceiver() as lr:
alive = lr.is_alive
GMS_objs = imap_unordered(run_complete_preprocessing, dataset_groups, flatten_output=True)
#with LogReceiver() as lr:
# alive = lr.is_alive
GMS_objs = imap_unordered(run_complete_preprocessing, dataset_groups, flatten_output=True)
# separate results into successful and failed objects
def assign_attr(tgt_procL):
......
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