Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Loggie
Commits
5cfb0175
Commit
5cfb0175
authored
2 years ago
by
ethfoo
Browse files
Options
Download
Email Patches
Plain Diff
Fix: do not update events in action print() of transformer interceptor
parent
70022760
fix-transformer-print
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/interceptor/transformer/action/print.go
+13
-3
pkg/interceptor/transformer/action/print.go
with
13 additions
and
3 deletions
+13
-3
pkg/interceptor/transformer/action/print.go
+
13
-
3
View file @
5cfb0175
...
...
@@ -19,8 +19,8 @@ package action
import
(
"github.com/loggie-io/loggie/pkg/core/api"
"github.com/loggie-io/loggie/pkg/core/cfg"
eventer
"github.com/loggie-io/loggie/pkg/core/event"
"github.com/loggie-io/loggie/pkg/core/log"
codecjson
"github.com/loggie-io/loggie/pkg/sink/codec/json"
"github.com/pkg/errors"
)
...
...
@@ -48,8 +48,18 @@ func NewPrint(args []string) (*Print, error) {
}
func
(
f
*
Print
)
act
(
e
api
.
Event
)
error
{
codec
:=
codecjson
.
NewJson
()
out
,
err
:=
codec
.
Encode
(
e
)
// TODO Encapsulated this into a function together with sink json codec
header
:=
make
(
map
[
string
]
interface
{})
for
k
,
v
:=
range
e
.
Header
()
{
header
[
k
]
=
v
}
if
len
(
e
.
Body
())
!=
0
{
// put body in header
header
[
eventer
.
Body
]
=
string
(
e
.
Body
())
}
out
,
err
:=
json
.
Marshal
(
header
)
if
err
!=
nil
{
return
err
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help