Skip to content

Commit a286c0c

Browse files
committed
no longer check isSendDefaultPii
1 parent 5900c4e commit a286c0c

2 files changed

Lines changed: 2 additions & 32 deletions

File tree

sentry/src/main/java/io/sentry/logger/LoggerApi.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,7 @@ private void captureLog(
214214
setServerName(attributes);
215215
}
216216

217-
if (scopes.getOptions().isSendDefaultPii()) {
218-
setUser(attributes);
219-
}
217+
setUser(attributes);
220218

221219
return attributes;
222220
}

sentry/src/test/java/io/sentry/ScopesTest.kt

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,10 +2852,9 @@ class ScopesTest {
28522852
}
28532853

28542854
@Test
2855-
fun `adds user fields to log attributes if sendDefaultPii is true`() {
2855+
fun `adds user fields to log attributes`() {
28562856
val (sut, mockClient) = getEnabledScopes {
28572857
it.logs.isEnabled = true
2858-
it.isSendDefaultPii = true
28592858
}
28602859

28612860
sut.configureScope { scope ->
@@ -2887,33 +2886,6 @@ class ScopesTest {
28872886
)
28882887
}
28892888

2890-
@Test
2891-
fun `does not add user fields to log attributes by default`() {
2892-
val (sut, mockClient) = getEnabledScopes {
2893-
it.logs.isEnabled = true
2894-
}
2895-
2896-
sut.configureScope { scope ->
2897-
scope.user = User().also {
2898-
it.id = "usrid"
2899-
it.username = "usrname"
2900-
it.email = "user@sentry.io"
2901-
}
2902-
}
2903-
sut.logger().log(SentryLogLevel.WARN, "log message")
2904-
2905-
verify(mockClient).captureLog(
2906-
check {
2907-
assertEquals("log message", it.body)
2908-
2909-
assertNull(it.attributes?.get("user.id"))
2910-
assertNull(it.attributes?.get("user.name"))
2911-
assertNull(it.attributes?.get("user.email"))
2912-
},
2913-
anyOrNull()
2914-
)
2915-
}
2916-
29172889
//endregion
29182890

29192891
@Test

0 commit comments

Comments
 (0)