fleet/server/logging/stdout.go

22 lines
342 B
Go
Raw Normal View History

package logging
import (
"context"
"encoding/json"
"fmt"
)
type stdoutLogWriter struct {
}
func NewStdoutLogWriter() (*stdoutLogWriter, error) {
return &stdoutLogWriter{}, nil
}
func (l *stdoutLogWriter) Write(ctx context.Context, logs []json.RawMessage) error {
for _, log := range logs {
fmt.Printf("%s\n", log)
}
return nil
}