Skip to content

Commit 0f107fd

Browse files
author
Enda Phelan
committed
fix: show name in log instead of ID
1 parent cac0fcd commit 0f107fd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/cmd/kafka/use/use.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package use
22

33
import (
4-
"github.com/bf2fc6cc711aee1a0c2a/cli/pkg/kafka"
5-
"github.com/bf2fc6cc711aee1a0c2a/cli/pkg/api/kas"
64
"context"
75
"fmt"
86

7+
"github.com/bf2fc6cc711aee1a0c2a/cli/pkg/api/kas"
8+
"github.com/bf2fc6cc711aee1a0c2a/cli/pkg/color"
9+
"github.com/bf2fc6cc711aee1a0c2a/cli/pkg/kafka"
10+
911
"github.com/MakeNowJust/heredoc"
1012

1113
"github.com/spf13/cobra"
@@ -78,7 +80,7 @@ func runUse(opts *options) error {
7880
if kas.IsErr(apiErr, kas.ErrorNotFound) {
7981
return kafka.ErrorNotFound(opts.id)
8082
}
81-
83+
8284
if apiErr.Error() != "" {
8385
return fmt.Errorf("Unable to retrieve Kafka instance \"%v\": %w", opts.id, apiErr)
8486
}
@@ -93,7 +95,7 @@ func runUse(opts *options) error {
9395
return fmt.Errorf("Unable to use Kafka instance: %w", err)
9496
}
9597

96-
logger.Infof("Using Kafka instance \"%v\"\n", *res.Id)
98+
logger.Infof("Now using Kafka instance %v.", color.Info(res.GetName()))
9799

98100
return nil
99101
}

0 commit comments

Comments
 (0)