Commit 32c30766 authored by Tristan Van Berkom's avatar Tristan Van Berkom

_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.
parent 1ec80edc
Pipeline #21796227 passed with stages
in 20 minutes
......@@ -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)
......
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