Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove logp.Warn from fmtstr (#15943) #15970

Merged
merged 1 commit into from
Jan 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions libbeat/common/fmtstr/formatevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ package fmtstr

import (
"bytes"
"errors"
"fmt"
"reflect"
"strconv"
"strings"
"sync"
"time"

"github.com/pkg/errors"

"github.com/elastic/beats/libbeat/beat"
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/common/dtfmt"
"github.com/elastic/beats/libbeat/logp"
)

// EventFormatString implements format string support on events
Expand Down Expand Up @@ -420,10 +420,9 @@ func fieldString(event *beat.Event, field string) (string, error) {

s, err := tryConvString(v)
if err != nil {
logp.Warn("Can not convert key '%v' value to string", v)
return s, errors.Wrapf(err, "can not convert key '%v' value to string", v)
}

return s, err
return s, nil
}

func tryConvString(v interface{}) (string, error) {
Expand Down