File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,12 @@ Operators set the logger for all operator logging in [`cmd/manager/main.go`][cod
8
8
9
9
``` Go
10
10
import (
11
- " github.com/operator-framework/operator-sdk/pkg/logutil"
12
11
logf " sigs.k8s.io/controller-runtime/pkg/runtime/log"
13
12
)
14
13
15
14
func main () {
16
15
logf.SetLogger (logf.ZapLogger (false ))
17
- log := logutil. SDKLog .WithName (" cmd" )
16
+ log := logf. Log .WithName (" cmd" )
18
17
19
18
...
20
19
@@ -37,12 +36,16 @@ An example from [`memcached_controller.go`][code_memcached_controller]:
37
36
``` Go
38
37
package memcached
39
38
39
+ import (
40
+ logf " sigs.k8s.io/controller-runtime/pkg/runtime/log"
41
+ )
42
+
40
43
// Set a global logger for the memcached package. Each log record produced
41
44
// by this logger will have an identifier containing "controller_memcached".
42
45
// These names are hierarchical; the name attached to memcached log statements
43
46
// will be "operator-sdk.controller_memcached" because SDKLog has name
44
47
// "operator-sdk".
45
- var log = logutil. SDKLog .WithName (" controller_memcached" )
48
+ var log = logf. Log .WithName (" controller_memcached" )
46
49
47
50
func (r *ReconcileMemcached ) Reconcile (request reconcile .Request ) (reconcile .Result , error ) {
48
51
// Create a logger for Reconcile() that includes "Request.Namespace"
You can’t perform that action at this time.
0 commit comments