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+
7779
7880class ExecuteLocal (Action ):
7981 """Action that begins executing a process on the local system and sets up event handlers."""
@@ -89,7 +91,7 @@ def __init__(
8991 'sigkill_timeout' , default = 5 ),
9092 emulate_tty : bool = False ,
9193 output : SomeSubstitutionsType = 'log' ,
92- output_format : Text = '[{this.process_description.final_name}] {line}' ,
94+ output_format : Text = DEFAULT_OUTPUT_FORMAT ,
9395 cached_output : bool = False ,
9496 log_cmd : bool = False ,
9597 on_exit : Optional [Union [
@@ -199,7 +201,14 @@ def __init__(
199201 self .__output = normalize_to_list_of_substitutions (tmp_output )
200202 else :
201203 self .__output = tmp_output
202- self .__output_format = output_format
204+
205+ # Check if an environment variable is set and use this as a default
206+ self .__output_format = os .environ .get (
207+ 'LAUNCH_OUTPUT_FORMAT' , output_format
208+ )
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
203212
204213 self .__log_cmd = log_cmd
205214 self .__cached_output = cached_output
0 commit comments