All Methods Logging
Until now, we used @LoggedFunction
or @LoggedRoute
decorator on every single methods in controller and service to use power of NestLogged.
But this can be annoying as the more method defined, and repeated decorator can cause the bad readability.
Therefore, NestLogged provides a decorator to apply @LoggedFunction
or @LoggedRoute
decorator to every methods in the class with a single apply in the class like @Controller
.
NestLogged provide this in two decorators.
@LoggedController
- This decorator applies@LoggedRoute
to every methods, and apply@Controller
in the class.@LoggedInjectable
- This decorator applies@LoggedFunction
to every methods, and apply@Injectable
in the class.
This two decorators are all applied in the same position with @Controller
or @Injectable
.
Also, it is not recommended to apply @LoggedRoute
or @LoggedFunction
in the class that is already applied with @LoggedController
or @LoggedInjectable
.
Last updated