vendredi 5 avril 2019

Design pattern for logging in AND out of method?

Hello stack overflow community. I am having an overall design and architecture question. After looking at design patterns (decorators, chain of commands, and so on) it is still unclear to me.

Requirement: I would like to have a design, a way, a design pattern to log the IN AND OUT of my methods.

As of now, all my methods looks like: (Below the logging, I am also using some KPI library to send some timestamp, like StatsD)

The structure is really of the form

Now, looking at my project, I have some 290 methods who are following the EXACT same structure.

Is there a clever way of resolving this? Maybe with a nice pattern? Some annotations? Aspects? I am open to suggestion as I believe there is definitely a better solution than my current.

Thank you so much for your help.

Aucun commentaire:

Enregistrer un commentaire