Skip to content

Commit 7300bdb

Browse files
call Monitor after ComposeUp
1 parent c7648d0 commit 7300bdb

2 files changed

Lines changed: 4 additions & 11 deletions

File tree

src/cmd/cli/command/compose.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,8 @@ func makeComposeUpCmd() *cobra.Command {
162162
return nil
163163
}
164164

165-
// show users the current streaming logs
166-
tailSource := "all services"
167-
if deploy.Etag != "" {
168-
tailSource = "deployment ID " + deploy.Etag
169-
}
170-
term.Info("Tailing logs for", tailSource, "; press Ctrl+C to detach:")
171-
172-
tailOptions := newTailOptionsForDeploy(deploy.Etag, since, global.Verbose)
173-
serviceStates, err := cli.TailAndMonitor(ctx, project, provider, time.Duration(waitTimeout)*time.Second, tailOptions)
165+
term.Info("Live tail logs with `defang tail --deployment=" + deploy.Etag + "`")
166+
serviceStates, err := cli.Monitor(ctx, project, provider, time.Duration(waitTimeout)*time.Second, deploy.Etag)
174167
if err != nil {
175168
deploymentErr := err
176169
debugger, err := debug.NewDebugger(ctx, global.Cluster, &global.Stack)

src/pkg/cli/tailAndMonitor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func Monitor(ctx context.Context, project *compose.Project, provider client.Prov
3131
_, computeServices := splitManagedAndUnmanagedServices(project.Services)
3232

3333
for _, svc := range computeServices {
34-
term.Infof("%s [%s] %s\n", time.Now().Format(time.TimeOnly), svc, "PENDING")
34+
term.Infof("[%s] %s\n", svc, "DEPLOYMENT_PENDING")
3535
}
3636

3737
var (
@@ -46,7 +46,7 @@ func Monitor(ctx context.Context, project *compose.Project, provider client.Prov
4646
serviceStates, svcErr = WatchServiceState(svcStatusCtx, provider, project.Name, deploymentID, computeServices, func(msg *defangv1.SubscribeResponse, states *ServiceStates) error {
4747
// Print service status updates as they arrive
4848
for name, state := range *states {
49-
term.Infof("%s [%s] %s\n", time.Now().Format(time.TimeOnly), name, state.String())
49+
term.Infof("[%s] %s\n", name, state.String())
5050
}
5151
return nil
5252
})

0 commit comments

Comments
 (0)