Skip to content

Commit a605326

Browse files
committed
Fix: collect early logging also in log file
1 parent fb0dbfa commit a605326

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

python/PiFinder/multiproclogging.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ def start(self, initial_queue: Optional[Queue] = None):
8787
len(self._queues) >= 1
8888
), "No queues in use. You should have requested at least one queue."
8989

90+
# Create the main-process queue BEFORE starting the sink so the sink
91+
# receives it in its queue list and monitors it.
92+
queue = initial_queue if initial_queue is not None else self.get_queue()
93+
9094
self._proc = Process(
9195
target=self._run_sink,
9296
args=(
@@ -97,7 +101,6 @@ def start(self, initial_queue: Optional[Queue] = None):
97101
# Start separate process that consumes from the queues.
98102
self._proc.start()
99103
# Now in this process we can divert logging to the newly created class
100-
queue = self.get_queue()
101104
MultiprocLogging.configurer(queue)
102105

103106
def join(self):

0 commit comments

Comments
 (0)