mirror of
https://github.com/docker/compose.git
synced 2025-07-01 10:54:29 +02:00
Merge pull request #11542 from ndeloof/log_attach
get log to manage `attach`
This commit is contained in:
commit
e2762b144e
@ -75,6 +75,16 @@ func runLogs(ctx context.Context, dockerCli command.Cli, backend api.Service, op
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// exclude services configured to ignore output (attach: false), until explicitly selected
|
||||||
|
if project != nil && len(services) == 0 {
|
||||||
|
for n, service := range project.Services {
|
||||||
|
if service.Attach == nil || *service.Attach {
|
||||||
|
services = append(services, n)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
consumer := formatter.NewLogConsumer(ctx, dockerCli.Out(), dockerCli.Err(), !opts.noColor, !opts.noPrefix, false)
|
consumer := formatter.NewLogConsumer(ctx, dockerCli.Out(), dockerCli.Err(), !opts.noColor, !opts.noPrefix, false)
|
||||||
return backend.Logs(ctx, name, consumer, api.LogOptions{
|
return backend.Logs(ctx, name, consumer, api.LogOptions{
|
||||||
Project: project,
|
Project: project,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user