Skip to content

Commit ad55d7d

Browse files
committed
feat(astro): use astro logger instead of console
1 parent 66ea1e6 commit ad55d7d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

packages/astro/src/integration/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as fs from 'fs';
22
import * as path from 'path';
3-
/* eslint-disable no-console */
43
import { sentryVitePlugin } from '@sentry/vite-plugin';
54
import type { AstroConfig, AstroIntegration } from 'astro';
65

@@ -14,7 +13,7 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
1413
name: PKG_NAME,
1514
hooks: {
1615
// eslint-disable-next-line complexity
17-
'astro:config:setup': async ({ updateConfig, injectScript, addMiddleware, config, command }) => {
16+
'astro:config:setup': async ({ updateConfig, injectScript, addMiddleware, config, command, logger }) => {
1817
// The third param here enables loading of all env vars, regardless of prefix
1918
// see: https://main.vitejs.dev/config/#using-environment-variables-in-config
2019

@@ -59,18 +58,18 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => {
5958
: findDefaultSdkInitFile('server');
6059

6160
if (pathToClientInit) {
62-
options.debug && console.log(`[sentry-astro] Using ${pathToClientInit} for client init.`);
61+
options.debug && logger.info(`Using ${pathToClientInit} for client init.`);
6362
injectScript('page', buildSdkInitFileImportSnippet(pathToClientInit));
6463
} else {
65-
options.debug && console.log('[sentry-astro] Using default client init.');
64+
options.debug && logger.info('[sentry-astro] Using default client init.');
6665
injectScript('page', buildClientSnippet(options || {}));
6766
}
6867

6968
if (pathToServerInit) {
70-
options.debug && console.log(`[sentry-astro] Using ${pathToServerInit} for server init.`);
69+
options.debug && logger.info(`Using ${pathToServerInit} for server init.`);
7170
injectScript('page-ssr', buildSdkInitFileImportSnippet(pathToServerInit));
7271
} else {
73-
options.debug && console.log('[sentry-astro] Using default server init.');
72+
options.debug && logger.info('Using default server init.');
7473
injectScript('page-ssr', buildServerSnippet(options || {}));
7574
}
7675

0 commit comments

Comments
 (0)