Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions .github/workflows/plugin-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ concurrency:
cancel-in-progress: true

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
# pull_request:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be added. Please run these tests locally. And PR will trigger CI automatically.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks! I’m testing the workflow to meet the CI requirements. I’ll create a new branch to avoid affecting this PR.


jobs:
build:
Expand Down
7 changes: 5 additions & 2 deletions tools/go-agent/instrument/logger/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,14 @@ func (span *NoopSpan) GetEndPointName() string {
}

func GetLogContext(withEndpoint bool) interface{} {
report, ok := GetOperator().LogReporter().(LogReporter)
operator := GetOperator()
if operator == nil {
return nil
}
report, ok := operator.LogReporter().(LogReporter)
if !ok || report == nil {
return nil
}

return report.GetLogContext(withEndpoint)
}

Expand Down
8 changes: 7 additions & 1 deletion tools/go-agent/instrument/logger/frameworks/logrus_adapt.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ import (
)

func UpdateLogrusLogger(l *logrus.Logger) {
if l == nil {
return
}

if LogTracingContextEnable {
if _, wrapperd := l.Formatter.(*WrapFormat); !wrapperd {
l.Formatter = Wrap(l.Formatter, LogTracingContextKey)
}
}
ChangeLogger(NewLogrusAdapter(l))
if ChangeLogger != nil {
ChangeLogger(NewLogrusAdapter(l))
}
}

type LogrusAdapter struct {
Expand Down