From 32c307664bfd576723c5d977a09d57ec3b9cd369 Mon Sep 17 00:00:00 2001 From: Tristan Van Berkom Date: Thu, 10 May 2018 15:58:17 +0900 Subject: _frontend/app.py: Fixed ordering of initialization sequence. We need the logging handler setup before creating the Stream(), as the Stream() will expect logging to be already functional. --- buildstream/_frontend/app.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py index de23c12b0..2ee6a770f 100644 --- a/buildstream/_frontend/app.py +++ b/buildstream/_frontend/app.py @@ -200,14 +200,6 @@ class App(): except BstError as e: self._error_exit(e, "Error loading project") - # Create the stream right away, we'll need to pass it around - self.stream = Stream(self.context, self.project, self._session_start, - session_start_callback=self.session_start_cb, - interrupt_callback=self._interrupt_handler, - ticker_callback=self._tick, - job_start_callback=self._job_started, - job_complete_callback=self._job_completed) - # Create the logger right before setting the message handler self.logger = LogLine(self.context, self._content_profile, @@ -217,12 +209,6 @@ class App(): self._detail_profile, indent=INDENT) - # Create our status printer, only available in interactive - self._status = Status(self.context, - self._content_profile, self._format_profile, - self._success_profile, self._error_profile, - self.stream, colors=self.colors) - # Propagate pipeline feedback to the user self.context.set_message_handler(self._message_handler) @@ -230,6 +216,20 @@ class App(): # we can override the global exception hook. sys.excepthook = self._global_exception_handler + # Create the stream right away, we'll need to pass it around + self.stream = Stream(self.context, self.project, self._session_start, + session_start_callback=self.session_start_cb, + interrupt_callback=self._interrupt_handler, + ticker_callback=self._tick, + job_start_callback=self._job_started, + job_complete_callback=self._job_completed) + + # Create our status printer, only available in interactive + self._status = Status(self.context, + self._content_profile, self._format_profile, + self._success_profile, self._error_profile, + self.stream, colors=self.colors) + # Mark the beginning of the session if session_name: self._message(MessageType.START, session_name) -- cgit v1.2.1