Skip to content

Commit 8b01cbc

Browse files
authored
1 parent 4bc8d71 commit 8b01cbc

File tree

3 files changed

+190
-0
lines changed

3 files changed

+190
-0
lines changed

static/app/data/platformCategories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ export const withoutPerformanceSupport: Set<PlatformKey> = new Set([
307307
// List of platforms that have logging onboarding checklist content
308308
export const withLoggingOnboarding: Set<PlatformKey> = new Set([
309309
'android',
310+
'dart',
311+
'flutter',
310312
'go',
311313
'go-echo',
312314
'go-fasthttp',

static/app/gettingStartedDocs/dart/dart.tsx

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,103 @@ Sentry.captureUserFeedback(userFeedback);`,
249249
nextSteps: () => [],
250250
};
251251

252+
const logsOnboarding: OnboardingConfig = {
253+
install: params => [
254+
{
255+
type: StepType.INSTALL,
256+
content: [
257+
{
258+
type: 'text',
259+
text: tct(
260+
'Logs for Dart are supported in SDK version [code:9.0.0] or higher. You can update your [pubspec:pubspec.yaml] to the matching version:',
261+
{
262+
code: <code />,
263+
pubspec: <code />,
264+
}
265+
),
266+
},
267+
{
268+
type: 'code',
269+
tabs: [
270+
{
271+
label: 'YAML',
272+
language: 'yaml',
273+
code: getInstallSnippet(params),
274+
},
275+
],
276+
},
277+
{
278+
type: 'text',
279+
text: tct(
280+
'If you are on an older major version of the SDK, follow our [link:migration guide] to upgrade.',
281+
{
282+
link: (
283+
<ExternalLink href="https://docs.sentry.io/platforms/dart/migration/" />
284+
),
285+
}
286+
),
287+
},
288+
],
289+
},
290+
],
291+
configure: params => [
292+
{
293+
type: StepType.CONFIGURE,
294+
content: [
295+
{
296+
type: 'text',
297+
text: tct(
298+
'To enable logging, you need to initialize the SDK with the [code:enableLogs] option set to [code:true].',
299+
{
300+
code: <code />,
301+
}
302+
),
303+
},
304+
{
305+
type: 'code',
306+
language: 'dart',
307+
code: `await Sentry.init(
308+
(options) {
309+
options.dsn = '${params.dsn.public}';
310+
// Enable logs to be sent to Sentry
311+
options.enableLogs = true;
312+
},
313+
);`,
314+
},
315+
],
316+
},
317+
],
318+
verify: () => [
319+
{
320+
type: StepType.VERIFY,
321+
content: [
322+
{
323+
type: 'text',
324+
text: t(
325+
'You can verify that logs are working by sending logs with the Sentry logger APIs.'
326+
),
327+
},
328+
{
329+
type: 'code',
330+
language: 'dart',
331+
code: `Sentry.logger.fmt.info("Test log from %s", ["Sentry"])`,
332+
},
333+
{
334+
type: 'text',
335+
text: tct('For more details, check out our [link:logs documentation].', {
336+
link: <ExternalLink href="https://docs.sentry.io/platforms/dart/logs/" />,
337+
}),
338+
},
339+
],
340+
},
341+
],
342+
};
343+
252344
const docs: Docs = {
253345
onboarding,
254346
feedbackOnboardingCrashApi: feedbackOnboardingCrashApiDart,
255347
crashReportOnboarding: feedbackOnboardingCrashApiDart,
348+
logsOnboarding,
256349
};
257350

258351
export default docs;

static/app/gettingStartedDocs/flutter/flutter.tsx

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,107 @@ const feedbackOnboarding: OnboardingConfig<PlatformOptions> = {
539539
nextSteps: () => [],
540540
};
541541

542+
const logsOnboarding: OnboardingConfig<PlatformOptions> = {
543+
install: params => [
544+
{
545+
type: StepType.INSTALL,
546+
content: [
547+
{
548+
type: 'text',
549+
text: tct(
550+
'Logs for Flutter are supported in SDK version [code:9.0.0] or higher. You can update your [pubspec:pubspec.yaml] to the matching version:',
551+
{
552+
code: <code />,
553+
pubspec: <code />,
554+
}
555+
),
556+
},
557+
{
558+
type: 'code',
559+
tabs: [
560+
{
561+
label: 'YAML',
562+
language: 'yaml',
563+
code: getManualInstallSnippet(params),
564+
},
565+
],
566+
},
567+
{
568+
type: 'text',
569+
text: tct(
570+
'If you are on an older major version of the SDK, follow our [link:migration guide] to upgrade.',
571+
{
572+
link: (
573+
<ExternalLink href="https://docs.sentry.io/platforms/dart/guides/flutter/migration/" />
574+
),
575+
}
576+
),
577+
},
578+
],
579+
},
580+
],
581+
configure: params => [
582+
{
583+
type: StepType.CONFIGURE,
584+
content: [
585+
{
586+
type: 'text',
587+
text: tct(
588+
'To enable logging, you need to initialize the SDK with the [code:enableLogs] option set to [code:true].',
589+
{
590+
code: <code />,
591+
}
592+
),
593+
},
594+
{
595+
type: 'code',
596+
language: 'dart',
597+
code: `await SentryFlutter.init(
598+
(options) {
599+
options.dsn = '${params.dsn.public}';
600+
// Enable logs to be sent to Sentry
601+
options.enableLogs = true;
602+
},
603+
);`,
604+
},
605+
],
606+
},
607+
],
608+
verify: () => [
609+
{
610+
type: StepType.VERIFY,
611+
content: [
612+
{
613+
type: 'text',
614+
text: t(
615+
'You can verify that logs are working by sending logs with the Sentry logger APIs.'
616+
),
617+
},
618+
{
619+
type: 'code',
620+
language: 'dart',
621+
code: `Sentry.logger.fmt.info("Test log from %s", ["Sentry"])`,
622+
},
623+
{
624+
type: 'text',
625+
text: tct('For more details, check out our [link:logs documentation].', {
626+
link: (
627+
<ExternalLink href="https://docs.sentry.io/platforms/dart/guides/flutter/logs/" />
628+
),
629+
}),
630+
},
631+
],
632+
},
633+
],
634+
};
635+
542636
const docs: Docs<PlatformOptions> = {
543637
onboarding,
544638
feedbackOnboardingNpm: feedbackOnboarding,
545639
crashReportOnboarding: feedbackOnboardingCrashApiDart,
546640
platformOptions,
547641
replayOnboarding,
642+
logsOnboarding,
548643
};
549644

550645
export default docs;

0 commit comments

Comments
 (0)