mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
32 lines
616 B
Go
32 lines
616 B
Go
package processor
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"log/slog"
|
|
|
|
"github.com/jwetzell/showbridge-go/internal/config"
|
|
)
|
|
|
|
type DebugLog struct {
|
|
config 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 config.ProcessorConfig) (Processor, error) {
|
|
return &DebugLog{config: config}, nil
|
|
},
|
|
})
|
|
}
|