@@ -12,6 +12,7 @@ import (
12
12
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
13
13
"sigs.k8s.io/yaml"
14
14
15
+ "github.com/flanksource/commons/logger"
15
16
"github.com/flanksource/duty/context"
16
17
"github.com/flanksource/duty/shutdown"
17
18
"github.com/flanksource/gomplate/v3"
@@ -42,7 +43,8 @@ func pretty(o any) string {
42
43
}
43
44
func RunConsumer (rootCtx context.Context , config Config ) error {
44
45
if config .LogLevel != "" {
45
- rootCtx .Logger .SetLogLevel (config .LogLevel )
46
+ logger .StandardLogger ().SetLogLevel (config .LogLevel )
47
+ rootCtx .Infof ("Set log level to %s => %v" , config .LogLevel , rootCtx .Logger .GetLevel ())
46
48
}
47
49
48
50
if config .client == nil {
@@ -82,6 +84,7 @@ func RunConsumer(rootCtx context.Context, config Config) error {
82
84
}
83
85
84
86
ctx := rootCtx .WithName (msg .LoggableID )
87
+ ctx .Logger .SetLogLevel (config .LogLevel )
85
88
86
89
// Attempt to decode Bas64
87
90
decoded , err := base64 .StdEncoding .DecodeString (string (msg .Body ))
@@ -99,7 +102,7 @@ func RunConsumer(rootCtx context.Context, config Config) error {
99
102
data ["_id" ] = msg .LoggableID
100
103
data ["_metadata" ] = msg .Metadata
101
104
102
- ctx .Debugf ("Received message: %+v" , pretty (data ))
105
+ ctx .Debugf ("Received message:\n %+v" , pretty (data ))
103
106
104
107
templater := gomplate.StructTemplater {
105
108
Values : data ,
0 commit comments