mirror of https://github.com/docker/compose.git
Merge pull request #1791 from afshinpaydar-binary/docker_compose_logs_since_option
This commit is contained in:
commit
9ea051f64e
|
@ -32,6 +32,8 @@ type logsOptions struct {
|
||||||
composeOptions
|
composeOptions
|
||||||
follow bool
|
follow bool
|
||||||
tail string
|
tail string
|
||||||
|
since string
|
||||||
|
until string
|
||||||
noColor bool
|
noColor bool
|
||||||
noPrefix bool
|
noPrefix bool
|
||||||
timestamps bool
|
timestamps bool
|
||||||
|
@ -50,6 +52,8 @@ func logsCommand(p *projectOptions, contextType string, backend api.Service) *co
|
||||||
}
|
}
|
||||||
flags := logsCmd.Flags()
|
flags := logsCmd.Flags()
|
||||||
flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output.")
|
flags.BoolVarP(&opts.follow, "follow", "f", false, "Follow log output.")
|
||||||
|
flags.StringVar(&opts.since, "since", "", "Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)")
|
||||||
|
flags.StringVar(&opts.until, "until", "", "Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)")
|
||||||
flags.BoolVar(&opts.noColor, "no-color", false, "Produce monochrome output.")
|
flags.BoolVar(&opts.noColor, "no-color", false, "Produce monochrome output.")
|
||||||
flags.BoolVar(&opts.noPrefix, "no-log-prefix", false, "Don't print prefix in logs.")
|
flags.BoolVar(&opts.noPrefix, "no-log-prefix", false, "Don't print prefix in logs.")
|
||||||
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps.")
|
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps.")
|
||||||
|
@ -70,6 +74,8 @@ func runLogs(ctx context.Context, backend api.Service, opts logsOptions, service
|
||||||
Services: services,
|
Services: services,
|
||||||
Follow: opts.follow,
|
Follow: opts.follow,
|
||||||
Tail: opts.tail,
|
Tail: opts.tail,
|
||||||
|
Since: opts.since,
|
||||||
|
Until: opts.until,
|
||||||
Timestamps: opts.timestamps,
|
Timestamps: opts.timestamps,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -324,6 +324,8 @@ type ServiceStatus struct {
|
||||||
type LogOptions struct {
|
type LogOptions struct {
|
||||||
Services []string
|
Services []string
|
||||||
Tail string
|
Tail string
|
||||||
|
Since string
|
||||||
|
Until string
|
||||||
Follow bool
|
Follow bool
|
||||||
Timestamps bool
|
Timestamps bool
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,8 @@ func (s *composeService) Logs(ctx context.Context, projectName string, consumer
|
||||||
ShowStdout: true,
|
ShowStdout: true,
|
||||||
ShowStderr: true,
|
ShowStderr: true,
|
||||||
Follow: options.Follow,
|
Follow: options.Follow,
|
||||||
|
Since: options.Since,
|
||||||
|
Until: options.Until,
|
||||||
Tail: options.Tail,
|
Tail: options.Tail,
|
||||||
Timestamps: options.Timestamps,
|
Timestamps: options.Timestamps,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue