File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ class Znp extends events.EventEmitter {
76
76
private onUnpiParsed ( frame : UnpiFrame ) : void {
77
77
try {
78
78
const object = ZpiObject . fromUnpiFrame ( frame ) ;
79
- logger . debug ( ( ) => `<-- ${ object } ` , NS ) ;
79
+ logger . debug ( ( ) => `<-- ${ object . toString ( object . subsystem !== Subsystem . ZDO ) } ` , NS ) ;
80
80
this . waitress . resolve ( object ) ;
81
81
this . emit ( 'received' , object ) ;
82
82
} catch ( error ) {
Original file line number Diff line number Diff line change @@ -142,8 +142,9 @@ class ZpiObject<T extends ZpiObjectType = 'Response'> {
142
142
) ;
143
143
}
144
144
145
- public toString ( ) : string {
146
- return `${ Type [ this . type ] } : ${ Subsystem [ this . subsystem ] } - ${ this . command . name } - ${ JSON . stringify ( this . payload ) } ` ;
145
+ public toString ( includePayload = true ) : string {
146
+ const baseStr = `${ Type [ this . type ] } : ${ Subsystem [ this . subsystem ] } - ${ this . command . name } ` ;
147
+ return includePayload ? baseStr + ` - ${ JSON . stringify ( this . payload ) } ` : baseStr ;
147
148
}
148
149
}
149
150
You can’t perform that action at this time.
0 commit comments