Skip to content

Commit

Permalink
⚠️ Remove deprecated runtime/log package
Browse files Browse the repository at this point in the history
Signed-off-by: Vince Prignano <vincepri@vmware.com>
  • Loading branch information
vincepri committed Aug 4, 2020
1 parent 4ffd908 commit 192ac97
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 96 deletions.
2 changes: 1 addition & 1 deletion examples/builtins/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
var log = logf.Log.WithName("example-controller")

func main() {
logf.SetLogger(zap.Logger(false))
logf.SetLogger(zap.New())
entryLog := log.WithName("entrypoint")

// Setup a Manager
Expand Down
2 changes: 1 addition & 1 deletion examples/crd/pkg/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package pkg

import (
"k8s.io/apimachinery/pkg/runtime/schema"
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

Expand Down
3 changes: 0 additions & 3 deletions pkg/internal/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// Package log contains utilities for fetching a new logger
// when one is not already available.
// Deprecated: use pkg/log
package log

import (
Expand Down
33 changes: 0 additions & 33 deletions pkg/log/zap/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,6 @@ func New(opts ...Opts) logr.Logger {
return zapr.NewLogger(NewRaw(opts...))
}

// Logger is a Logger implementation.
// If development is true, a Zap development config will be used
// (stacktraces on warnings, no sampling), otherwise a Zap production
// config will be used (stacktraces on errors, sampling).
//
// Deprecated: use New() and the functional opts pattern instead:
//
// New(UseDevMode(development))
func Logger(development bool) logr.Logger {
return LoggerTo(os.Stderr, development)
}

// LoggerTo returns a new Logger implementation using Zap which logs
// to the given destination, instead of stderr. It otherwise behaves like
// ZapLogger.
//
// Deprecated: use New() and the functional opts pattern instead:
//
// New(UseDevMode(development), WriteTo(writer))
func LoggerTo(destWriter io.Writer, development bool) logr.Logger {
return zapr.NewLogger(RawLoggerTo(destWriter, development))
}

// RawLoggerTo returns a new zap.Logger configured with KubeAwareEncoder
// which logs to a given destination
//
// Deprecated: use NewRaw() and the functional opts pattern instead:
//
// NewRaw(UseDevMode(development), WriteTo(destWriter), RawZapOpts(opts...))
func RawLoggerTo(destWriter io.Writer, development bool, opts ...zap.Option) *zap.Logger {
return NewRaw(UseDevMode(development), WriteTo(destWriter), RawZapOpts(opts...))
}

// Opts allows to manipulate Options
type Opts func(*Options)

Expand Down
58 changes: 0 additions & 58 deletions pkg/runtime/log/log.go

This file was deleted.

0 comments on commit 192ac97

Please sign in to comment.