Skip to content

Use Zap Log Levels #64

@zacharyblasczyk

Description

@zacharyblasczyk

We are wrapping logs in a r.debug flag.

Example:

	if r.Debug {
		log.Info("Initial desired spec", "spec", desiredSpec.SensitiveValuesMasked())
	}

We should be setting up the log level based on that debug flag on time in the main.go
So update is needed here:

	logger := zap.New(zap.UseFlagOptions(&opts))
	ctrl.SetLogger(logger)

The logging can be greatly simplified and we don't need to pass the debug flag around if we just do this proper.

By default we should log info logs, and then if debug is set, we should be logging info and debug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions