18 from multiprocessing.connection
import Connection
22 from ..._folder_manager
import folder_manager
23 from ...utils
import createFileHandler
26 def sendSuccess(conn: Connection, message: str) ->
None:
33 def sendFailure(conn: Connection, message: str) ->
None:
40 def initializeLogger(taskRunId: int) ->
None:
41 formatter = logging.Formatter(
42 fmt =
"%(asctime)s %(levelname)s: %(message)s",
43 datefmt =
"%Y-%m-%d %H:%M:%S",
47 workerLogPath = folder_manager.getRunLogsDir(taskRunId) /
"worker.log"
48 fileHandler = createFileHandler(workerLogPath)
50 fileHandler.setLevel(logging.DEBUG)
51 fileHandler.setFormatter(formatter)
54 level = logging.NOTSET,
56 handlers = [fileHandler]