summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-05-10 15:58:17 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-05-10 15:59:47 +0900
commit32c307664bfd576723c5d977a09d57ec3b9cd369 (patch)
tree254b8e50d5845bf11c7bc3fe98c22a9d797cd866
parent1ec80edc1e80bf03b5eeca500d62da64977a24dd (diff)
downloadbuildstream-32c307664bfd576723c5d977a09d57ec3b9cd369.tar.gz
_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.
-rw-r--r--buildstream/_frontend/app.py28
1 files 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)