I have dozens of Classes w开发者_运维知识库ith 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
You can try backtrace, but its hard to implament. And some information here.
There is a way for protected & private methods, however AFAIK none to log public method calls.
Why would you want to do that?
If you want to see the execution plan you can :
- run a xdebug profiling
- run your application in a debugger
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.
精彩评论