Don't log downsample warning when unnecessary (#4291)
* fix log use process.env ensure the log happens regardless of `isDownsampledSession` fix log * oops, revert testzio/stable
parent
d6275e98c2
commit
8e2c21a882
|
@ -102,15 +102,18 @@ export function logEvent<E extends keyof LogEvents>(
|
|||
rawMetadata: LogEvents[E] & FlatJSONRecord,
|
||||
) {
|
||||
try {
|
||||
if (isDownsampledSession && DOWNSAMPLED_EVENTS.has(eventName)) {
|
||||
return
|
||||
}
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
if (eventName.endsWith(':sampled')) {
|
||||
if (
|
||||
process.env.NODE_ENV === 'development' &&
|
||||
eventName.endsWith(':sampled') &&
|
||||
!DOWNSAMPLED_EVENTS.has(eventName)
|
||||
) {
|
||||
logger.error(
|
||||
'Did you forget to add ' + eventName + ' to DOWNSAMPLED_EVENTS?',
|
||||
)
|
||||
}
|
||||
|
||||
if (isDownsampledSession && DOWNSAMPLED_EVENTS.has(eventName)) {
|
||||
return
|
||||
}
|
||||
const fullMetadata = {
|
||||
...rawMetadata,
|
||||
|
|
Loading…
Reference in New Issue