I want to wrap every function call with some logging code. Something that would produce output like:
func1(param1, param2)
func2(param1)
func3()
func4(param1, param2)
Ideally, I would like an API of the form:
function globalBefore(func);
function globalAfter(func);
I've googled quite a bit for this, but it seems like there's only aspect-oriented solutions that require you to wrap the specific functions you want to log, or whatever. I want something that applies to every function in the global scope (except itself, obviously).
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…