Skip to content

Commit

Permalink
Improve ftl status output readability (#456)
Browse files Browse the repository at this point in the history
Added JSON formatting w/ indents & line breaks for the ftl status output
-- previously was a giant JSON all on one line
  • Loading branch information
KendallWeihe authored Oct 5, 2023
1 parent d90132e commit d8576da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/ftl/cmd_ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (s *psCmd) Run(ctx context.Context, client ftlv1connect.ControllerServiceCl
return errors.WithStack(err)
}
if s.JSON {
marshaller := jsonpb.Marshaler{}
marshaller := jsonpb.Marshaler{Indent: " "}
for _, process := range status.Msg.Processes {
err = marshaller.Marshal(os.Stdout, process)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion cmd/ftl/cmd_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ func (s *statusCmd) Run(ctx context.Context, client ftlv1connect.ControllerServi
deployment.Schema = nil
}
}
return errors.WithStack((&jsonpb.Marshaler{}).Marshal(os.Stdout, status.Msg))
return errors.WithStack((&jsonpb.Marshaler{
Indent: " ",
}).Marshal(os.Stdout, status.Msg))
}

0 comments on commit d8576da

Please sign in to comment.