logged() function
Logger decorator factory for class methods. Will try, catch and log errors during method calls. If logger is bypassed, will use given logger, otherwise will try to use logger defined on class dynamically or statically or will fallback to console.
Signature:
export declare function logged(options?: ILogger | LoggedDecoratorOptions): (target: any, methodName: string | symbol, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => void;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
options |
ILogger | LoggedDecoratorOptions |
(Optional) custom logger or logged decorator options {Function} - decorator function |
Returns:
(target: any, methodName: string | symbol, descriptor: TypedPropertyDescriptor<(...args: any[]) => any>) => void