Skip to content

Commit 6463a17

Browse files
Merge branch 'feat/replay' into kw/add-sentry-babel-transaformer
2 parents 49e403a + 9672e88 commit 6463a17

File tree

5 files changed

+28
-5
lines changed

5 files changed

+28
-5
lines changed

samples/expo/utils/setScopeProperties.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,12 @@ export const setScopeProperties = () => {
7676
category: 'TEST-CATEGORY',
7777
});
7878

79+
console.log('This is a console log message.');
80+
console.info('This is a console info message.');
81+
console.warn('This is a console warn message.');
82+
console.error('This is a console error message.');
83+
console.debug('This is a console debug message.');
84+
console.trace('This is a console trace message.');
85+
7986
console.log('Test scope properties were set.');
8087
};

samples/react-native/src/App.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { LogBox, Platform, StyleSheet, View } from 'react-native';
3232
import { HttpClient } from '@sentry/integrations';
3333
import Ionicons from 'react-native-vector-icons/Ionicons';
3434
import PlaygroundScreen from './Screens/PlaygroundScreen';
35+
import { logWithoutTracing } from './utils';
3536

3637
LogBox.ignoreAllLogs();
3738

@@ -49,16 +50,19 @@ Sentry.init({
4950
debug: true,
5051
environment: 'dev',
5152
beforeSend: (event: Sentry.Event) => {
52-
console.log('Event beforeSend:', event.event_id);
53+
logWithoutTracing('Event beforeSend:', event.event_id);
5354
return event;
5455
},
5556
beforeSendTransaction(event) {
56-
console.log('Transaction beforeSend:', event.event_id);
57+
logWithoutTracing('Transaction beforeSend:', event.event_id);
5758
return event;
5859
},
5960
// This will be called with a boolean `didCallNativeInit` when the native SDK has been contacted.
6061
onReady: ({ didCallNativeInit }) => {
61-
console.log('onReady called with didCallNativeInit:', didCallNativeInit);
62+
logWithoutTracing(
63+
'onReady called with didCallNativeInit:',
64+
didCallNativeInit,
65+
);
6266
},
6367
integrations(integrations) {
6468
integrations.push(

samples/react-native/src/Screens/TrackerScreen.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ const TrackerScreen = () => {
6969
(state === 'loaded' && 'Loaded') ||
7070
'Unknown';
7171
const shouldRecordFullDisplay = state === 'loaded' || state === 'error';
72-
console.log('shouldRecordFullDisplay', shouldRecordFullDisplay);
73-
console.log('statusText', statusText);
7472

7573
return (
7674
<View style={styles.screen}>

samples/react-native/src/setScopeProperties.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,12 @@ export const setScopeProperties = () => {
7676
category: 'TEST-CATEGORY',
7777
});
7878

79+
console.log('This is a console log message.');
80+
console.info('This is a console info message.');
81+
console.warn('This is a console warn message.');
82+
console.error('This is a console error message.');
83+
console.debug('This is a console debug message.');
84+
console.trace('This is a console trace message.');
85+
7986
console.log('Test scope properties were set.');
8087
};

samples/react-native/src/utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function logWithoutTracing(...args: unknown[]) {
2+
if ('__sentry_original__' in console.log) {
3+
console.log.__sentry_original__(...args);
4+
} else {
5+
console.log(...args);
6+
}
7+
}

0 commit comments

Comments
 (0)