improve local loggin

This commit is contained in:
Abhinav 2023-01-31 11:21:11 +05:30
parent f7b76ee7c3
commit 564b822dbf

View file

@ -1,5 +1,4 @@
import * as Sentry from '@sentry/nextjs';
import { isDEVSentryENV } from 'constants/sentry';
import { addLogLine } from 'utils/logging';
import { getSentryUserID } from 'utils/user';
@ -17,12 +16,9 @@ export const logError = async (
addLogLine(
`error: ${error?.name} ${error?.message} ${
error?.stack
} msg: ${msg} info: ${JSON.stringify(info)}`
} msg: ${msg} ${info ? `info: ${JSON.stringify(info)}` : ''}`
);
}
if (isDEVSentryENV()) {
console.log(error, { msg, info });
}
Sentry.captureException(err, {
level: Sentry.Severity.Info,
user: { id: await getSentryUserID() },