Skip to content

Commit

Permalink
Merge pull request moby#32462 from dperny/service-logs-general-availa…
Browse files Browse the repository at this point in the history
…bility

Remove experimental from service logs
  • Loading branch information
vieux committed Apr 11, 2017
2 parents 988d885 + a29c0a6 commit 7a0d2db
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions command/service/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,22 @@ func newLogsCommand(dockerCli *command.DockerCli) *cobra.Command {
var opts logsOptions

cmd := &cobra.Command{
Use: "logs [OPTIONS] SERVICE",
Short: "Fetch the logs of a service",
Use: "logs [OPTIONS] SERVICE|TASK",
Short: "Fetch the logs of a service or task",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
opts.target = args[0]
return runLogs(dockerCli, &opts)
},
Tags: map[string]string{"experimental": ""},
Tags: map[string]string{"version": "1.29"},
}

flags := cmd.Flags()
// options specific to service logs
flags.BoolVar(&opts.noResolve, "no-resolve", false, "Do not map IDs to Names in output")
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Do not truncate output")
flags.BoolVar(&opts.noTaskIDs, "no-task-ids", false, "Do not include task IDs in output")
// options identical to container logs
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:37) or relative (e.g. 42m for 42 minutes)")
flags.BoolVarP(&opts.timestamps, "timestamps", "t", false, "Show timestamps")
Expand Down Expand Up @@ -94,6 +96,8 @@ func runLogs(dockerCli *command.DockerCli, opts *logsOptions) error {
tty = task.Spec.ContainerSpec.TTY
// TODO(dperny) hot fix until we get a nice details system squared away,
// ignores details (including task context) if we have a TTY log
// if we don't do this, we'll vomit the huge context verbatim into the
// TTY log lines and that's Undesirable.
if tty {
options.Details = false
}
Expand Down

0 comments on commit 7a0d2db

Please sign in to comment.