Skip to content

Commit 86143c3

Browse files
committed
remove logutil from logging.md
1 parent 0da5d62 commit 86143c3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

doc/dev/logging.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@ Operators set the logger for all operator logging in [`cmd/manager/main.go`][cod
88

99
```Go
1010
import (
11-
"github.com/operator-framework/operator-sdk/pkg/logutil"
1211
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
1312
)
1413

1514
func main() {
1615
logf.SetLogger(logf.ZapLogger(false))
17-
log := logutil.SDKLog.WithName("cmd")
16+
log := logf.Log.WithName("cmd")
1817

1918
...
2019

@@ -37,12 +36,16 @@ An example from [`memcached_controller.go`][code_memcached_controller]:
3736
```Go
3837
package memcached
3938

39+
import (
40+
logf "sigs.k8s.io/controller-runtime/pkg/runtime/log"
41+
)
42+
4043
// Set a global logger for the memcached package. Each log record produced
4144
// by this logger will have an identifier containing "controller_memcached".
4245
// These names are hierarchical; the name attached to memcached log statements
4346
// will be "operator-sdk.controller_memcached" because SDKLog has name
4447
// "operator-sdk".
45-
var log = logutil.SDKLog.WithName("controller_memcached")
48+
var log = logf.Log.WithName("controller_memcached")
4649

4750
func (r *ReconcileMemcached) Reconcile(request reconcile.Request) (reconcile.Result, error) {
4851
// Create a logger for Reconcile() that includes "Request.Namespace"

0 commit comments

Comments
 (0)