File tree Expand file tree Collapse file tree
main/java/io/sentry/logger Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments