Skip to content

Commit 0e416a9

Browse files
committed
chore: update
1 parent 162322a commit 0e416a9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/logger/src/index.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@ class Logger extends Service {
5858
appLogger.warn(format, ...args)
5959
})
6060

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-
})
61+
if (typeof process !== 'undefined') {
62+
process.on('uncaughtException', (error) => {
63+
appLogger.error(error)
64+
process.exitCode = 1
65+
})
66+
67+
process.on('unhandledRejection', (error) => {
68+
appLogger.warn(error)
69+
})
70+
}
6971

7072
let showTime = config.showTime
7173
if (showTime === true) showTime = 'yyyy-MM-dd hh:mm:ss'

0 commit comments

Comments
 (0)