Correct transports
This commit is contained in:
+2
-5
@@ -6,20 +6,17 @@ import {consoleTransport} from '#/logger/transports/console'
|
|||||||
import {sentryTransport} from '#/logger/transports/sentry'
|
import {sentryTransport} from '#/logger/transports/sentry'
|
||||||
import {LogContext, LogLevel, Metadata, Transport} from '#/logger/types'
|
import {LogContext, LogLevel, Metadata, Transport} from '#/logger/types'
|
||||||
import {enabledLogLevels} from '#/logger/util'
|
import {enabledLogLevels} from '#/logger/util'
|
||||||
import {isWeb} from '#/platform/detection'
|
|
||||||
|
|
||||||
const TRANSPORTS: Transport[] = (function configureTransports() {
|
const TRANSPORTS: Transport[] = (function configureTransports() {
|
||||||
switch (process.env.NODE_ENV) {
|
switch (process.env.NODE_ENV) {
|
||||||
case 'production': {
|
case 'production': {
|
||||||
return [isWeb && sentryTransport, bitdriftTransport].filter(
|
return [sentryTransport, bitdriftTransport].filter(Boolean) as Transport[]
|
||||||
Boolean,
|
|
||||||
) as Transport[]
|
|
||||||
}
|
}
|
||||||
case 'test': {
|
case 'test': {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
return [consoleTransport, bitdriftTransport]
|
return [consoleTransport]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
|||||||
Reference in New Issue
Block a user