Skip to content

Commit fe6793b

Browse files
committed
Fix search output
Signed-off-by: Juan Antonio Osorio <ozz@stacklok.com>
1 parent 0a284bb commit fe6793b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/thv/search.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func searchCmdFunc(_ *cobra.Command, args []string) error {
4545
}
4646

4747
if len(servers) == 0 {
48-
logger.Log.Info(fmt.Sprintf("No servers found matching query: %s", query))
48+
fmt.Printf("No servers found matching query: %s\n", query)
4949
return nil
5050
}
5151

@@ -59,7 +59,7 @@ func searchCmdFunc(_ *cobra.Command, args []string) error {
5959
case "json":
6060
return printJSONSearchResults(servers)
6161
default:
62-
logger.Log.Info(fmt.Sprintf("Found %d servers matching query: %s", len(servers), query))
62+
fmt.Printf("Found %d servers matching query: %s\n", len(servers), query)
6363
printTextSearchResults(servers)
6464
return nil
6565
}
@@ -74,7 +74,7 @@ func printJSONSearchResults(servers []*registry.Server) error {
7474
}
7575

7676
// Print JSON
77-
logger.Log.Info(string(jsonData))
77+
fmt.Println(string(jsonData))
7878
return nil
7979
}
8080

@@ -102,7 +102,7 @@ func printTextSearchResults(servers []*registry.Server) {
102102

103103
// Flush the tabwriter
104104
if err := w.Flush(); err != nil {
105-
logger.Log.Warn(fmt.Sprintf("Warning: Failed to flush tabwriter: %v", err))
105+
fmt.Fprintf(os.Stderr, "Warning: Failed to flush tabwriter: %v\n", err)
106106
}
107107
}
108108

0 commit comments

Comments
 (0)