You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
IsolatePath/OpEnvStubSingleOpEnvStub/PathOpEnvStub all use GlobalStateRequestor to send requests, and the logs printed by GlobalStateRequestor should be controlled by parameters instead of randomly printing OpEnv types
To Reproduce
For example : IsolatePath/PathOpEnvStub can call this function,why the log just print path_op_env ,This is a bad log, which will cause the user to view the log and cannot distinguish the OpEnv type
publicasyncload(req: OpEnvLoadOutputRequest): Promise<BuckyResult<void>>{if(this.op_env_type_!==ObjectMapOpEnvType.Single&&this.op_env_type_!==ObjectMapOpEnvType.IsolatePath){consterr_msg=`load method only valid for single_op_env and isolate_path_op_env! sid = ${this.sid_}`;console.log(err_msg);returnOk(undefined);}console.info(`will load for path_op_env: sid=${this.sid_}, target=${req.target}`);consthttp_req=this.encode_load_request(req);constr=awaitthis.requestor_.request(http_req);if(r.err){console.error(`load for path_op_env request failed: sid=${this.sid_}, target=${req.target}, ret=${r}`);returnr;}constresp=r.unwrap();if(http_status_code_ok(resp.status)){console.info(`load for path_op_env success: sid=${this.sid_}, target=${req.target}`);returnOk(undefined);}else{conste=awaitRequestorHelper.error_from_resp(resp);console.error(`load for path_op_env failed: sid=${this.sid_}, target=${req.target}, err=${e}`);returnErr(e);}}
The other functions of the class OpEnvRequestor have the same problem
Expected behavior
OpEnvRequestor can identify the specific OpEnv type through op_env_type_, it is recommended to optimize the log
Currently, ObjectMapOpEnvType in this.op_env_type_ used to communicate CYFS Stack with the CYFS protocol, its value is not designed for reading. If you use ObjectMapOpEnvType in the log, readability will be significantly reduced.
For example: will load for path_op_env will become will load for path, or will load for single.
Adding a prefix to the log to optimize readability will only turn it into will load for op_env type path, or will load for op_env type isolate-path.
Describe the bug
IsolatePath/OpEnvStubSingleOpEnvStub/PathOpEnvStub all use GlobalStateRequestor to send requests, and the logs printed by GlobalStateRequestor should be controlled by parameters instead of randomly printing OpEnv types
[[cyfs-ts-sdk] https://github.com/buckyos/cyfs-ts-sdk/src/sdk/cyfs-lib/root_state/requestor.ts](https://github.com/buckyos/cyfs-ts-sdk/blob/beta/src/sdk/cyfs-lib/root_state/requestor.ts)
To Reproduce
For example : IsolatePath/PathOpEnvStub can call this function,why the log just print path_op_env ,This is a bad log, which will cause the user to view the log and cannot distinguish the OpEnv type
Expected behavior
OpEnvRequestor can identify the specific OpEnv type through op_env_type_, it is recommended to optimize the log
System information
[[cyfs-ts-sdk] https://github.com/buckyos/cyfs-ts-sdk/src/sdk/cyfs-lib/root_state/requestor.ts](https://github.com/buckyos/cyfs-ts-sdk/blob/beta/src/sdk/cyfs-lib/root_state/requestor.ts)
The text was updated successfully, but these errors were encountered: