Skip to content

Restore task element name / element name distinction in UI

Tristan Van Berkom requested to merge tristan/fix-logging-element-names into master
This behavior has regressed a while back when introducing the messenger
object in 0026e379 from merge request !1500.

Main behavior change:

  - Messages in the master log always appear with the task element's
    element name and cache key, even if the element or plugin issuing
    the log line is not the primary task element.

  - Messages logged in the task specific log, retain the context of the
    element names and cache keys which are issuing the log lines.

Changes include:

  * _message.py: Added the task element name & key members

  * _messenger.py: Log the element key as well if it is provided

  * _widget.py: Prefer the task name & key when logging, we fallback
    to the element name & key in case messages are being logged outside
    of any ongoing task (main process/context)

  * job.py: Unconditionally stamp messages with the task name & key

    Also removed some unused parameters here, clearing up an XXX comment

  * plugin.py: Make _message() internal so that element.py can override it

  * element.py: Override _message() so that we can add the issuing element's
    cache key to the message context.

Fixes #1393

Merge request reports