We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 162322a commit 0e416a9Copy full SHA for 0e416a9
packages/logger/src/index.ts
@@ -58,14 +58,16 @@ class Logger extends Service {
58
appLogger.warn(format, ...args)
59
})
60
61
- process.on('uncaughtException', (error) => {
62
- appLogger.error(error)
63
- process.exitCode = 1
64
- })
65
-
66
- process.on('unhandledRejection', (error) => {
67
- appLogger.warn(error)
68
+ if (typeof process !== 'undefined') {
+ process.on('uncaughtException', (error) => {
+ appLogger.error(error)
+ process.exitCode = 1
+ })
+
+ process.on('unhandledRejection', (error) => {
+ appLogger.warn(error)
69
70
+ }
71
72
let showTime = config.showTime
73
if (showTime === true) showTime = 'yyyy-MM-dd hh:mm:ss'
0 commit comments