7474from ..utilities .type_utils import normalize_typed_substitution
7575from ..utilities .type_utils import perform_typed_substitution
7676
77- DEFAULT_OUTPUT_FORMAT = '[{this.process_description.final_name}] {line}'
78-
7977
8078class ExecuteLocal (Action ):
8179 """Action that begins executing a process on the local system and sets up event handlers."""
@@ -91,7 +89,7 @@ def __init__(
9189 'sigkill_timeout' , default = 5 ),
9290 emulate_tty : bool = False ,
9391 output : SomeSubstitutionsType = 'log' ,
94- output_format : Text = DEFAULT_OUTPUT_FORMAT ,
92+ output_format : Text = '[{this.process_description.final_name}] {line}' ,
9593 cached_output : bool = False ,
9694 log_cmd : bool = False ,
9795 on_exit : Optional [Union [
@@ -175,6 +173,7 @@ def __init__(
175173 :param: output_format for logging each output line, supporting `str.format()`
176174 substitutions with the following keys in scope: `line` to reference the raw
177175 output line and `this` to reference this action instance.
176+ Overridden externally by the OVERRIDE_LAUNCH_OUTPUT_FORMAT envvar value.
178177 :param: log_cmd if True, prints the final cmd before executing the
179178 process, which is useful for debugging when substitutions are
180179 involved.
@@ -202,13 +201,11 @@ def __init__(
202201 else :
203202 self .__output = tmp_output
204203
205- # Check if an environment variable is set and use this as a default
204+ self .__output_format = output_format
205+ # Check if an environment variable is set and override anything given as argument
206206 self .__output_format = os .environ .get (
207- 'LAUNCH_OUTPUT_FORMAT ' , output_format
207+ 'OVERRIDE_LAUNCH_OUTPUT_FORMAT ' , self . __output_format
208208 )
209- # Setting it locally in the launch file still overwrites the default
210- if output_format != DEFAULT_OUTPUT_FORMAT :
211- self .__output_format = output_format
212209
213210 self .__log_cmd = log_cmd
214211 self .__cached_output = cached_output
0 commit comments