Skip to content

Commit 83acfe8

Browse files
committed
Use fmt.Fprintf to stderr for debug logging
- Change from log.Printf to fmt.Fprintf(os.Stderr) for visibility - Ensure debug output appears in container logs
1 parent ba70475 commit 83acfe8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/homer/config.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,12 +1164,12 @@ func createIngressItem(ingress networkingv1.Ingress, host string, validRuleCount
11641164

11651165
// Append cluster name suffix from label if set (only for remote clusters)
11661166
if clusterName, ok := ingress.ObjectMeta.Annotations["homer.rajsingh.info/cluster"]; ok && clusterName != "" && clusterName != "local" {
1167-
log.Printf("DEBUG: Ingress %s from cluster %s, labels: %v", ingress.ObjectMeta.Name, clusterName, ingress.ObjectMeta.Labels)
1167+
fmt.Fprintf(os.Stderr, "DEBUG: Ingress %s from cluster %s, labels: %v\n", ingress.ObjectMeta.Name, clusterName, ingress.ObjectMeta.Labels)
11681168
if suffix, hasSuffix := ingress.ObjectMeta.Labels["cluster-name-suffix"]; hasSuffix && suffix != "" {
1169-
log.Printf("DEBUG: Appending suffix %q to name %q", suffix, name)
1169+
fmt.Fprintf(os.Stderr, "DEBUG: Appending suffix %q to name %q\n", suffix, name)
11701170
name = name + suffix
11711171
} else {
1172-
log.Printf("DEBUG: No cluster-name-suffix label found for %s", ingress.ObjectMeta.Name)
1172+
fmt.Fprintf(os.Stderr, "DEBUG: No cluster-name-suffix label found for %s\n", ingress.ObjectMeta.Name)
11731173
}
11741174
}
11751175

@@ -1291,12 +1291,12 @@ func updateHomerConfigWithHTTPRoutes(
12911291

12921292
// Append cluster name suffix from label if set (only for remote clusters)
12931293
if clusterName, ok := httproute.ObjectMeta.Annotations["homer.rajsingh.info/cluster"]; ok && clusterName != "" && clusterName != "local" {
1294-
log.Printf("DEBUG: HTTPRoute %s from cluster %s, labels: %v", httproute.ObjectMeta.Name, clusterName, httproute.ObjectMeta.Labels)
1294+
fmt.Fprintf(os.Stderr, "DEBUG: HTTPRoute %s from cluster %s, labels: %v\n", httproute.ObjectMeta.Name, clusterName, httproute.ObjectMeta.Labels)
12951295
if suffix, hasSuffix := httproute.ObjectMeta.Labels["cluster-name-suffix"]; hasSuffix && suffix != "" {
1296-
log.Printf("DEBUG: Appending suffix %q to name %q", suffix, name)
1296+
fmt.Fprintf(os.Stderr, "DEBUG: Appending suffix %q to name %q\n", suffix, name)
12971297
name = name + suffix
12981298
} else {
1299-
log.Printf("DEBUG: No cluster-name-suffix label found for %s", httproute.ObjectMeta.Name)
1299+
fmt.Fprintf(os.Stderr, "DEBUG: No cluster-name-suffix label found for %s\n", httproute.ObjectMeta.Name)
13001300
}
13011301
}
13021302

0 commit comments

Comments
 (0)