For Example In Javascript:
function logger(args) {
console.log('Func "' + args.callee.name + '" invoked.');
for (var arg in args) {
console.log(arg); //well I cannot get those arguments' name in js
}
}
function doSomething(x, y, z) {
logger(this.arguments);
//do something...
}
How can I do something similar to that in C#?
Actually, I was about to implement a Web Service Logger in my program. Any suggestion for that?
Thanks to all.
edited: Sorry I didn't make it clearer. I knew that System.Reflection.MethodBase.GetCurrentMethod()
could get me the caller function's MethodInfo, but the arguments' value is what I concerned more.