Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Adds SCOPE_INSTRUMENTATION_TESTING_LOGGER env var #247

Merged
merged 2 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions autoinstrument/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

"go.undefinedlabs.com/scopeagent"
"go.undefinedlabs.com/scopeagent/agent"
"go.undefinedlabs.com/scopeagent/env"
"go.undefinedlabs.com/scopeagent/instrumentation"
scopegocheck "go.undefinedlabs.com/scopeagent/instrumentation/gocheck"
scopetesting "go.undefinedlabs.com/scopeagent/instrumentation/testing"
Expand All @@ -35,8 +36,10 @@ func init() {
defer func() {
logOnError(runPatch.Patch())
}()
scopetesting.PatchTestingLogger()
defer scopetesting.UnpatchTestingLogger()
if env.ScopeInstrumentationTestingLogger.Value {
scopetesting.PatchTestingLogger()
defer scopetesting.UnpatchTestingLogger()
}
return scopeagent.Run(m, agent.WithGlobalPanicHandler())
})
logOnError(err)
Expand Down
1 change: 1 addition & 0 deletions env/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ var (
ScopeRunnerIncludeBranches = newSliceEnvVar(nil, "SCOPE_RUNNER_INCLUDE_BRANCHES")
ScopeRunnerExcludeBranches = newSliceEnvVar(nil, "SCOPE_RUNNER_EXCLUDE_BRANCHES")
ScopeDependenciesIndirect = newBooleanEnvVar(false, "SCOPE_DEPENDENCIES_INDIRECT")
ScopeInstrumentationTestingLogger = newBooleanEnvVar(true, "`SCOPE_INSTRUMENTATION_TESTING_LOGGER`")
)