improve local loggin
This commit is contained in:
parent
f7b76ee7c3
commit
564b822dbf
|
@ -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() },
|
||||
|
|
Loading…
Reference in a new issue