seed icon indicating copy to clipboard operation
seed copied to clipboard

feat(back): add logger decorator

Open spy4x opened this issue 1 year ago • 0 comments

Right now LogService usage is a nasty overwhelming boilerplate.

Every controller's endpoint and command/query/event handler function look like this:

async methodName(...params): ReturnType {
    return this.logger.trackSegment(this.methodName.name, async () => {
      ... actual code ...
    }, {params});
  }

It would be neat to simplify this to just:

@Logger()
async methodName(...params): ReturnType {
      ... actual code ...
}

spy4x avatar Nov 17 '22 08:11 spy4x