Skip to content

Commit bba233e

Browse files
authoredJan 11, 2021
Merge pull request #554 from rabbitmq/logger
Make logger configurable
2 parents 9b239ea + 66d4415 commit bba233e

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed
 

‎config/default/overlays/dev/manager_image_patch.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ spec:
1717
- image: ((operator_docker_image))
1818
name: operator
1919
imagePullPolicy: Always
20+
args: ["--zap-devel"]

‎config/default/overlays/kind/manager_image_patch.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ spec:
1717
- image: ((operator_docker_image))
1818
name: operator
1919
imagePullPolicy: IfNotPresent
20+
args: ["--zap-devel"]

‎main.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@ func init() {
4545
func main() {
4646
var metricsAddr string
4747
flag.StringVar(&metricsAddr, "metrics-addr", ":12345", "The address the metric endpoint binds to.")
48+
49+
opts := zap.Options{}
50+
opts.BindFlags(flag.CommandLine)
51+
4852
flag.Parse()
4953

50-
ctrl.SetLogger(zap.New(zap.UseDevMode(true)))
54+
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
5155

5256
operatorNamespace := os.Getenv("OPERATOR_NAMESPACE")
5357
if operatorNamespace == "" {

0 commit comments

Comments
 (0)
Please sign in to comment.