Home All Groups Group Topic Archive Search About

Logging method values

Author
21 Nov 2007 3:33 PM
ssg31415926
I want to log all of the values passed into each method to help
diagnosing problems that can't be reproduced in test (yet).  Is there
an easy way to do this or do I have to write logging code specific to
each method?

Author
22 Nov 2007 11:28 AM
Alexander Vasilevsky
Please try
StackFrame fr = new StackFrame(1,true);
StackTrace st = new StackTrace(fr);
EventLog.WriteEntry(fr.GetMethod().Name,
                    st.ToString(),
                    EventLogEntryType.Warning);

http://www.alvas.net  - Audio tools for C# and VB.Net developers


Show quote
"ssg31415926" <newsjunkm***@gmail.com> ???????/???????? ? ????????
?????????:
news:c1911277-1ead-478b-8220-5cb3b0a4b6d9@a28g2000hsc.googlegroups.com...
>I want to log all of the values passed into each method to help
> diagnosing problems that can't be reproduced in test (yet).  Is there
> an easy way to do this or do I have to write logging code specific to
> each method?

AddThis Social Bookmark Button