Skip to content

Commit

Permalink
testdata: output: Use Error level log
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
cosmo0920 committed Jul 5, 2022
1 parent 57bb631 commit 6edd02e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions testdata/output/output.go
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ func (plug *outputPlugin) Init(ctx context.Context, fbit *plugin.Fluentbit) erro
func (plug outputPlugin) Flush(ctx context.Context, ch <-chan plugin.Message) error {
f, err := os.Create("/fluent-bit/etc/output.txt")
if err != nil {
plug.log.Error("[go-test-output-plugin] operation failed. reason %w", err)
return fmt.Errorf("could not open output.txt: %w", err)
}

@@ -39,6 +40,7 @@ func (plug outputPlugin) Flush(ctx context.Context, ch <-chan plugin.Message) er

_, err := fmt.Fprintf(f, "message=\"got record\" tag=%s time=%s record=%+v\n", msg.Tag(), msg.Time.Format(time.RFC3339), msg.Record)
if err != nil {
plug.log.Error("[go-test-output-plugin] operation failed. reason %w", err)
return fmt.Errorf("could not write to output.txt: %w", err)
}
}

0 comments on commit 6edd02e

Please sign in to comment.