add a logging processor

This commit is contained in:
Joel Wetzell
2025-11-22 16:59:16 -06:00
parent 7bc7087ffe
commit fdefad44ab
2 changed files with 29 additions and 5 deletions

View File

@@ -0,0 +1,29 @@
package processing
import (
"context"
"fmt"
"log/slog"
)
type DebugLog struct {
config ProcessorConfig
}
func (dl *DebugLog) Process(ctx context.Context, payload any) (any, error) {
slog.Debug("debug.log", "payload", payload, "payloadType", fmt.Sprintf("%T", payload))
return payload, nil
}
func (dl *DebugLog) Type() string {
return dl.config.Type
}
func init() {
RegisterProcessor(ProcessorRegistration{
Type: "debug.log",
New: func(config ProcessorConfig) (Processor, error) {
return &DebugLog{config: config}, nil
},
})
}