Is there a way to get an array of the arguments passed to a method?

后端 未结 9 1327
小蘑菇
小蘑菇 2020-12-05 18:17

Say I have a method:

 public void SomeMethod(String p1, String p2, int p3)
 {

 #if DEBUG
    object[] args = GetArguments();
    LogParamaters(args);
 #endi         


        
9条回答
  •  借酒劲吻你
    2020-12-05 18:46

    Well params help with the log call, but won't help the existing method signatures. Logging using an AOP framework might be a more productive approach?

提交回复
热议问题