fix: Add logging to Terraform install (#4191)

Fixes #4129.
This commit is contained in:
Kyle Carberry
2022-09-24 14:55:17 -05:00
committed by GitHub
parent 4054a9c7cb
commit 112eaf80d1
2 changed files with 3 additions and 2 deletions

View File

@ -303,7 +303,7 @@ func (api *API) runEntitlementsLoop(ctx context.Context) {
api.Logger.Debug(ctx, "successfully subscribed to pubsub") api.Logger.Debug(ctx, "successfully subscribed to pubsub")
} }
api.Logger.Info(ctx, "syncing licensed entitlements") api.Logger.Debug(ctx, "syncing licensed entitlements")
err := api.updateEntitlements(ctx) err := api.updateEntitlements(ctx)
if err != nil { if err != nil {
api.Logger.Warn(ctx, "failed to get feature entitlements", slog.Error(err)) api.Logger.Warn(ctx, "failed to get feature entitlements", slog.Error(err))

View File

@ -98,7 +98,8 @@ func Serve(ctx context.Context, options *ServeOptions) error {
Product: product.Terraform, Product: product.Terraform,
Version: TerraformVersion, Version: TerraformVersion,
} }
installer.SetLogger(slog.Stdlib(ctx, options.Logger, slog.LevelDebug))
options.Logger.Info(ctx, "installing terraform", slog.F("dir", options.CachePath), slog.F("version", TerraformVersion))
execPath, err := installer.Install(ctx) execPath, err := installer.Install(ctx)
if err != nil { if err != nil {
return xerrors.Errorf("install terraform: %w", err) return xerrors.Errorf("install terraform: %w", err)