-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more logs to tail and service status monitor #518
Conversation
Slight restructure of the service monitor and tail code to improve readbablity
printEndpoints(serviceInfos) | ||
|
||
if err != nil { | ||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the detach message regression
if !errors.As(err, &cerr) { | ||
term.Warnf("failed to start tailing, you will not be able to see logs: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am on the fence if this warning is needed
if !errors.Is(err, context.Canceled) && !errors.Is(err, cli.ErrDryRun) && !errors.As(err, new(cliClient.ErrNotImplemented)) { | ||
term.Info("Service status monitoring failed, we will continue tailing the logs. Press Ctrl+C to detach.") | ||
} | ||
term.Debugf("failed to wait for service status: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code would be much simpler if we don't need to log these, but we risk swallow errors for debugging
@@ -825,30 +824,25 @@ var composeUpCmd = &cobra.Command{ | |||
return nil | |||
} | |||
|
|||
tailCtx, cancelTail := context.WithCancel(ctx) | |||
tailCtx, cancelTail := contextWithServiceStatus(ctx, cli.ServiceStarted, serviceInfos) | |||
defer cancelTail() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how can this happen? startTailing blocks? You do <-Done()
so this cancel is just for cleanup, in which case the name is wrong.
And also slight restructure of the service monitor and tail code to improve readability.