Skip to content

Commit 5836aba

Browse files
committed
Migrate deprecated EmitLog calls to EmitInfo
1 parent 53aa465 commit 5836aba

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

internal/auth/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func (a *Auth) GetToken(ctx context.Context) (string, error) {
4141
return "", fmt.Errorf("authentication required: set LOCALSTACK_AUTH_TOKEN or run in interactive mode")
4242
}
4343

44-
output.EmitLog(a.sink, "No existing credentials found. Please log in:")
44+
output.EmitInfo(a.sink, "No existing credentials found. Please log in:")
4545
token, err := a.login.Login(ctx)
4646
if err != nil {
4747
output.EmitWarning(a.sink, "Authentication failed.")
@@ -52,7 +52,7 @@ func (a *Auth) GetToken(ctx context.Context) (string, error) {
5252
output.EmitWarning(a.sink, fmt.Sprintf("could not store token in keyring: %v", err))
5353
}
5454

55-
output.EmitLog(a.sink, "Login successful.")
55+
output.EmitSuccess(a.sink, "Login successful.")
5656
return token, nil
5757
}
5858

internal/auth/login.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ func (l *loginProvider) Login(ctx context.Context) (string, error) {
3535
}
3636

3737
authURL := fmt.Sprintf("%s/auth/request/%s", getWebAppURL(), authReq.ID)
38-
output.EmitLog(l.sink, fmt.Sprintf("Visit: %s", authURL))
39-
output.EmitLog(l.sink, fmt.Sprintf("Verification code: %s", authReq.Code))
38+
output.EmitInfo(l.sink, fmt.Sprintf("Visit: %s", authURL))
39+
output.EmitInfo(l.sink, fmt.Sprintf("Verification code: %s", authReq.Code))
4040

4141
// Ask whether to open the browser; ENTER or Y accepts (default yes), N skips
4242
browserCh := make(chan output.InputResponse, 1)
@@ -53,7 +53,7 @@ func (l *loginProvider) Login(ctx context.Context) (string, error) {
5353
}
5454
if resp.SelectedKey != "n" {
5555
if err := browser.OpenURL(authURL); err != nil {
56-
output.EmitLog(l.sink, fmt.Sprintf("Warning: Failed to open browser: %v", err))
56+
output.EmitWarning(l.sink, fmt.Sprintf("Failed to open browser: %v", err))
5757
}
5858
}
5959
case <-ctx.Done():
@@ -84,22 +84,22 @@ func getWebAppURL() string {
8484
}
8585

8686
func (l *loginProvider) completeAuth(ctx context.Context, authReq *api.AuthRequest) (string, error) {
87-
output.EmitLog(l.sink, "Checking if auth request is confirmed...")
87+
output.EmitInfo(l.sink, "Checking if auth request is confirmed...")
8888
confirmed, err := l.platformClient.CheckAuthRequestConfirmed(ctx, authReq.ID, authReq.ExchangeToken)
8989
if err != nil {
9090
return "", fmt.Errorf("failed to check auth request: %w", err)
9191
}
9292
if !confirmed {
9393
return "", fmt.Errorf("auth request not confirmed - please complete the authentication in your browser")
9494
}
95-
output.EmitLog(l.sink, "Auth request confirmed, exchanging for token...")
95+
output.EmitInfo(l.sink, "Auth request confirmed, exchanging for token...")
9696

9797
bearerToken, err := l.platformClient.ExchangeAuthRequest(ctx, authReq.ID, authReq.ExchangeToken)
9898
if err != nil {
9999
return "", fmt.Errorf("failed to exchange auth request: %w", err)
100100
}
101101

102-
output.EmitLog(l.sink, "Fetching license token...")
102+
output.EmitInfo(l.sink, "Fetching license token...")
103103
licenseToken, err := l.platformClient.GetLicenseToken(ctx, bearerToken)
104104
if err != nil {
105105
return "", fmt.Errorf("failed to get license token: %w", err)

internal/container/start.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func selectContainersToStart(ctx context.Context, rt runtime.Runtime, sink outpu
139139
return nil, fmt.Errorf("failed to check container status: %w", err)
140140
}
141141
if running {
142-
output.EmitLog(sink, fmt.Sprintf("%s is already running", c.Name))
142+
output.EmitInfo(sink, fmt.Sprintf("%s is already running", c.Name))
143143
continue
144144
}
145145
if err := ports.CheckAvailable(c.Port); err != nil {

internal/output/events.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ func EmitLog(sink Sink, message string) {
123123
Emit(sink, MessageEvent{Severity: SeverityInfo, Text: message})
124124
}
125125

126-
// Deprecated: Use EmitWarning with MessageEvent instead
127126
func EmitWarning(sink Sink, message string) {
128127
Emit(sink, MessageEvent{Severity: SeverityWarning, Text: message})
129128
}

internal/ui/components/spinner_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestSpinner_Update(t *testing.T) {
4848
s := NewSpinner()
4949
s = s.Start("Loading")
5050

51-
s, cmd := s.Update(spinner.TickMsg{})
51+
_, cmd := s.Update(spinner.TickMsg{})
5252
if cmd == nil {
5353
t.Fatal("expected non-nil command from spinner update")
5454
}

0 commit comments

Comments
 (0)