Skip to content

Commit

Permalink
cli: use logger instead of fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerdev committed Feb 6, 2024
1 parent d5dce14 commit 90e9aba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cli/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -95,7 +96,7 @@ func runGenerate(cmd *cobra.Command, args []string) error {
return fmt.Errorf("failed to write manifest: %w", err)
}

fmt.Fprintf(cmd.OutOrStdout(), "Updated manifest %s\n", flags.manifestPath)
log.Info("Updated manifest", "path", flags.manifestPath)

return nil
}
Expand Down Expand Up @@ -176,7 +177,8 @@ func generatePolicies(ctx context.Context, regoPath, policyPath string, yamlPath
if policyHash == [32]byte{} {
continue
}
fmt.Printf("%x %s\n", policyHash, yamlPath)

logger.Info("Calculated policy hash", "hash", hex.EncodeToString(policyHash[:]), "path", yamlPath)
}
return nil
}
Expand Down

0 comments on commit 90e9aba

Please sign in to comment.