Skip to content

Commit de3e501

Browse files
enable logs on expo sample (#5178)
1 parent 6fee48d commit de3e501

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

samples/expo/app/(tabs)/index.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,20 @@ export default function TabOneScreen() {
192192
}}
193193
/>
194194
</View>
195+
<View style={styles.buttonWrapper}>
196+
<Button
197+
title="Sentry Logger"
198+
onPress={() => {
199+
Sentry.logger.info('expo info log');
200+
Sentry.logger.trace('expo trace log');
201+
Sentry.logger.debug('expo debug log');
202+
Sentry.logger.warn('expo warn log');
203+
Sentry.logger.error('expo error log');
204+
205+
Sentry.logger.info('expo info log with data', { database: 'admin', number: 123, obj: { password: 'admin'} });
206+
}}
207+
/>
208+
</View>
195209
</View>
196210
</ScrollView>
197211
);

samples/expo/app/_layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Sentry.init({
3131
dsn: SENTRY_INTERNAL_DSN,
3232
debug: true,
3333
environment: 'dev',
34+
enableLogs: true,
3435
beforeSend: (event: Sentry.ErrorEvent) => {
3536
console.log('Event beforeSend:', event.event_id);
3637
return event;

0 commit comments

Comments
 (0)