|
|
@@ -610,11 +610,12 @@ class TopLevelCommand:
|
|
|
Usage: logs [options] [--] [SERVICE...]
|
|
|
|
|
|
Options:
|
|
|
- --no-color Produce monochrome output.
|
|
|
- -f, --follow Follow log output.
|
|
|
- -t, --timestamps Show timestamps.
|
|
|
- --tail="all" Number of lines to show from the end of the logs
|
|
|
- for each container.
|
|
|
+ --no-color Produce monochrome output.
|
|
|
+ -f, --follow Follow log output.
|
|
|
+ -t, --timestamps Show timestamps.
|
|
|
+ --tail="all" Number of lines to show from the end of the logs
|
|
|
+ for each container.
|
|
|
+ --no-log-prefix Don't print prefix in logs.
|
|
|
"""
|
|
|
containers = self.project.containers(service_names=options['SERVICE'], stopped=True)
|
|
|
|
|
|
@@ -635,7 +636,8 @@ class TopLevelCommand:
|
|
|
containers,
|
|
|
set_no_color_if_clicolor(options['--no-color']),
|
|
|
log_args,
|
|
|
- event_stream=self.project.events(service_names=options['SERVICE'])).run()
|
|
|
+ event_stream=self.project.events(service_names=options['SERVICE']),
|
|
|
+ keep_prefix=not options['--no-log-prefix']).run()
|
|
|
|
|
|
def pause(self, options):
|
|
|
"""
|
|
|
@@ -1017,6 +1019,7 @@ class TopLevelCommand:
|
|
|
container. Implies --abort-on-container-exit.
|
|
|
--scale SERVICE=NUM Scale SERVICE to NUM instances. Overrides the
|
|
|
`scale` setting in the Compose file if present.
|
|
|
+ --no-log-prefix Don't print prefix in logs.
|
|
|
"""
|
|
|
start_deps = not options['--no-deps']
|
|
|
always_recreate_deps = options['--always-recreate-deps']
|
|
|
@@ -1028,6 +1031,7 @@ class TopLevelCommand:
|
|
|
detached = options.get('--detach')
|
|
|
no_start = options.get('--no-start')
|
|
|
attach_dependencies = options.get('--attach-dependencies')
|
|
|
+ keep_prefix = not options['--no-log-prefix']
|
|
|
|
|
|
if detached and (cascade_stop or exit_value_from or attach_dependencies):
|
|
|
raise UserError(
|
|
|
@@ -1094,7 +1098,8 @@ class TopLevelCommand:
|
|
|
set_no_color_if_clicolor(options['--no-color']),
|
|
|
{'follow': True},
|
|
|
cascade_stop,
|
|
|
- event_stream=self.project.events(service_names=service_names))
|
|
|
+ event_stream=self.project.events(service_names=service_names),
|
|
|
+ keep_prefix=keep_prefix)
|
|
|
print("Attaching to", list_containers(log_printer.containers))
|
|
|
cascade_starter = log_printer.run()
|
|
|
|
|
|
@@ -1382,10 +1387,11 @@ def log_printer_from_project(
|
|
|
log_args,
|
|
|
cascade_stop=False,
|
|
|
event_stream=None,
|
|
|
+ keep_prefix=True,
|
|
|
):
|
|
|
return LogPrinter(
|
|
|
containers,
|
|
|
- build_log_presenters(project.service_names, monochrome),
|
|
|
+ build_log_presenters(project.service_names, monochrome, keep_prefix),
|
|
|
event_stream or project.events(),
|
|
|
cascade_stop=cascade_stop,
|
|
|
log_args=log_args)
|