Logger: Add feature toggle for errors in HTTP request logs (#64425)

This commit is contained in:
Emil Tullstedt
2023-03-31 15:38:09 +02:00
committed by GitHub
parent 977a7e9a55
commit be9361cb9e
19 changed files with 488 additions and 199 deletions
+3 -3
View File
@@ -34,7 +34,7 @@ func TestCanGetRouteNameFromContext(t *testing.T) {
assert.NoError(t, err)
handler, _ := routeOperationName(req)
handler, _ := RouteOperationName(req)
assert.Equal(t, tc.expected, handler)
}
}
@@ -46,13 +46,13 @@ func TestOperationNameCanOnlyBeSetOnce(t *testing.T) {
req = addRouteNameToContext(req, "first")
// check that the operation name is set correctly
value, exists := routeOperationName(req)
value, exists := RouteOperationName(req)
assert.True(t, exists, "route name should exist")
assert.Equal(t, "first", value)
// check that it cannot be overwritten
req = addRouteNameToContext(req, "second")
value, exists = routeOperationName(req)
value, exists = RouteOperationName(req)
assert.True(t, exists, "route name should exist")
assert.Equal(t, "first", value)
}