Skip to content

Commit

Permalink
middleware/logger: trim callback data delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
demget committed Oct 20, 2020
1 parent 8805f24 commit 1755696
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion middleware/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ func Logger(logger *logrus.Logger, fieldsFunc ...LoggerFieldsFunc) tele.Middlewa
return func(c tele.Context) error {
data := c.Data()
if clb := c.Callback(); clb != nil {
data = clb.Unique + "|" + data
uniq := clb.Unique
if data == "" {
data = uniq
} else {
data = uniq + "|" + data
}
} else if data == "" {
data = c.Text()
}
Expand Down

0 comments on commit 1755696

Please sign in to comment.