Reputation: 404
I have dozens of Classes with a unique ParentClass, i need implements a way to create a log each time any method is executed !
Have a way to do this only in the ParentClass or something like?
thanks, Celso
Upvotes: 1
Views: 345
Reputation: 2493
You can try backtrace, but its hard to implament. And some information here.
Upvotes: 1
Reputation: 3282
Why would you want to do that?
If you want to see the execution plan you can :
If it's for something else, don't do it. It will only make your code harder to read and fill your HDs with useless data that you can have whenever you want using points 1) ou 2) described above.
Edit : my company does exactly what you want and I assure you you don't want to get there.
Upvotes: 0
Reputation: 6992
There is a way for protected & private methods, however AFAIK none to log public method calls.
Upvotes: 0