This repository was archived by the owner on May 1, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -79,12 +79,13 @@ export function createNotificationServer(config: ServeConfig) {
79
79
// we've successfully connected
80
80
wsServer = ws ;
81
81
82
- wsServer . on ( 'message' , ( incomingMessage : string ) => {
82
+ wsServer . on ( 'message' , ( incomingMessage : any ) => {
83
83
// incoming message from the client
84
84
try {
85
85
printMessageFromClient ( JSON . parse ( incomingMessage ) ) ;
86
86
} catch ( e ) {
87
87
Logger . error ( `error opening ws message: ${ incomingMessage } ` ) ;
88
+ Logger . error ( e . stack ? e . stack : e ) ;
88
89
}
89
90
} ) ;
90
91
@@ -112,22 +113,23 @@ export function createNotificationServer(config: ServeConfig) {
112
113
function printConsole ( msg : WsMessage ) {
113
114
const args = msg . data ;
114
115
args [ 0 ] = `console.${ msg . type } : ${ args [ 0 ] } ` ;
116
+ const log = args . join ( ' ' ) ;
115
117
116
118
switch ( msg . type ) {
117
119
case 'error' :
118
- Logger . error . apply ( this , args ) ;
120
+ Logger . error ( log ) ;
119
121
break ;
120
122
121
123
case 'warn' :
122
- Logger . warn . apply ( this , args ) ;
124
+ Logger . warn ( log ) ;
123
125
break ;
124
126
125
127
case 'debug' :
126
- Logger . debug . apply ( this , args ) ;
128
+ Logger . debug ( log ) ;
127
129
break ;
128
130
129
131
default :
130
- Logger . info . apply ( this , args ) ;
132
+ Logger . info ( log ) ;
131
133
break ;
132
134
}
133
135
}
You can’t perform that action at this time.
0 commit comments