Page Contents

Home > @loopback/logging > logInvocation

logInvocation() function

@logInvocation decorator for method invocations.

Signature:

export declare function logInvocation(): (target: any, method?: string | undefined, methodDescriptor?: TypedPropertyDescriptor<any> | undefined) => any;

Returns:

(target: any, method?: string | undefined, methodDescriptor?: TypedPropertyDescriptor<any> | undefined) => any

Example

import {logInvocation} from '@loopback/logging';

export class HelloController {
  @logInvocation()
  hello(name: string) {
    return `Hello, ${name}`;
  }
}