Skip to content

Commit

Permalink
fix: debug messages in 'ftl new' command output
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman committed Jan 7, 2025
1 parent ee10607 commit c3dbe93
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion backend/provisioner/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func provisionerIDToProvisioner(ctx context.Context, id string, controller ftlv1
default:
plugin, _, err := plugin.Spawn(
ctx,
log.Debug,
log.FromContext(ctx).GetLevel(),
"ftl-provisioner-"+id,
".",
"ftl-provisioner-"+id,
Expand Down
2 changes: 2 additions & 0 deletions frontend/cli/cmd_new.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ func (i newCmd) Run(ctx context.Context, ktctx *kong.Context, config projectconf
}
}
_ = plugin.Kill() //nolint:errcheck

fmt.Printf("Successfully created %s module %q in %s\n", i.Language, name, path)
return nil
}

Expand Down
22 changes: 11 additions & 11 deletions frontend/cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ func main() {

app := createKongApplication(&cli, csm)

// Dynamically update the kong app with language specific flags for the "ftl new" command.
languagePlugin, err := languageplugin.PrepareNewCmd(log.ContextWithNewDefaultLogger(ctx), app, os.Args[1:])
app.FatalIfErrorf(err)
addToExit(app, func(code int) {
// Kill the plugin when the app exits due to an error, or after showing help.
languagePlugin.Close()
})

kctx, err := app.Parse(os.Args[1:])
app.FatalIfErrorf(err)

Expand All @@ -119,9 +111,6 @@ func main() {
defer trace.Stop()
}

// Plugins take time to launch, so we bind the "ftl new" plugin to the kong context.
kctx.Bind(languagePlugin)

if !cli.Plain {
sm := terminal.NewStatusManager(ctx)
csm.statusManager = optional.Some(sm)
Expand All @@ -147,6 +136,17 @@ func main() {
logger := log.Configure(os.Stderr, cli.LogConfig)
ctx = log.ContextWithLogger(ctx, logger)

// Dynamically update the kong app with language specific flags for the "ftl new" command.
languagePlugin, err := languageplugin.PrepareNewCmd(log.ContextWithLogger(ctx, logger), app, os.Args[1:])
app.FatalIfErrorf(err)
addToExit(app, func(code int) {
// Kill the plugin when the app exits due to an error, or after showing help.
languagePlugin.Close()
})

// Plugins take time to launch, so we bind the "ftl new" plugin to the kong context.
kctx.Bind(languagePlugin)

if cli.Insecure {
logger.Warnf("--insecure skips TLS certificate verification")
}
Expand Down

0 comments on commit c3dbe93

Please sign in to comment.