Skip to content

Commit

Permalink
feat: add logger for decoder/encoder options
Browse files Browse the repository at this point in the history
  • Loading branch information
killagu committed May 22, 2023
1 parent 91ba177 commit 6a87c18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/client/connection/rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ class RpcConnection extends Base {
sentReqs: this._sentReqs,
classCache: this.options.classCache || new Map(),
address: this.address,
logger: this.options.logger,
};
const decodeOpts = {
sentReqs: this._sentReqs,
classCache: this.options.classCache || new Map(),
address: this.address,
logger: this.options.logger,
};

// 针对 classMap 针对 hessian, proto 针对 protobuf
Expand Down
2 changes: 2 additions & 0 deletions lib/server/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ class RpcConnection extends Base {
const encodeOpts = {
sentReqs: this._sentReqs,
classCache: this.options.classCache || new Map(),
logger: this.options.logger,
};
const decodeOpts = {
sentReqs: this._sentReqs,
classCache: this.options.classCache || new Map(),
logger: this.options.logger,
};
// 针对 classMap 针对 hessian, proto 针对 protobuf
// 因为可能需要同时支持,所以分开设置(一般通过全局设置,所以这里要判断是否有值)
Expand Down

0 comments on commit 6a87c18

Please sign in to comment.