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
The activity method in the Logger interface is expected to return void based on the provided TypeScript signature, but in the actual implementation, it returns an id. This mismatch causes a TypeScript error when attempting to use the return value of the activity method, despite following the documentation.
Example code:
constactivity=logger.activity("Preparing data for JSON output...")// Warning: Void function return value is used
Expected behavior
The activity method should return an id based on the implementation. The TypeScript signature should be updated to reflect this.
Code snippets
The current Logger type signature:
exporttypeLogger={panic: (data: any)=>void;shouldLog: (level: string)=>void;setLogLevel: (level: string)=>void;unsetLogLevel: ()=>void;activity: (message: string,config?: any)=>void;// This should be updated to return an idprogress: (activityId: any,message: any)=>void;error: (messageOrError: any,error?: any)=>void;failure: (activityId: any,message: any)=>void;success: (activityId: any,message: any)=>void;debug: (message: any)=>void;info: (message: any)=>void;warn: (message: any)=>void;log: (...args: any[])=>void;};
Additional context
The activity method is clearly returning an id, but the TypeScript signature in the Logger type indicates it returns void. This mismatch causes a TypeScript warning when using the return value of the activity method, despite it following the documented behavior. The expected fix would be to update the Logger type to reflect that activity returns a string (or any other appropriate type).
The text was updated successfully, but these errors were encountered:
Describe the bug
The activity method in the Logger interface is expected to return void based on the provided TypeScript signature, but in the actual implementation, it returns an id. This mismatch causes a TypeScript error when attempting to use the return value of the activity method, despite following the documentation.
Example code:
Expected behavior
The activity method should return an id based on the implementation. The TypeScript signature should be updated to reflect this.
Code snippets
The current Logger type signature:
Additional context
The activity method is clearly returning an id, but the TypeScript signature in the Logger type indicates it returns void. This mismatch causes a TypeScript warning when using the return value of the activity method, despite it following the documented behavior. The expected fix would be to update the Logger type to reflect that activity returns a string (or any other appropriate type).
The text was updated successfully, but these errors were encountered: