Showing posts with label debug. Show all posts
Showing posts with label debug. Show all posts

Wednesday, June 16, 2010

TraceSource

Yesterday I was trying to get the TraceSource (http://msdn.microsoft.com/en-us/library/ms228993.aspx) working in C# under mono. I have been following the example in Microsoft website, but nothing seems to work. Today, I finally manage to get the TraceSource working. It turns out that I need to include TRACE as a define symbols in the compiler option (see the image below).



After making this change, my code

TraceSource ts = new TraceSource("DefaultTraceSource");
ts.TraceEvent (TraceEventType.Error, 1, "test");


works perfectly as intended.

Another catch I found with TraceSource is that the switchName attribute in the source element seems to be got ignored. To define the switch level, it seems better to use the switchValue attribute in the source element directly.

Sunday, January 31, 2010

PHP Helps

One of my PHP page was giving me hassles, and in order to make my life easy, I use a PHP formatter such as PHP Formatter to format my code for me, and insert comments at the end of each block to help me to see if there are any miss match braces. It works pretty well.

Other toolds I found which can help web coding easier are:
More can be found at http://www.smashingmagazine.com/2007/07/12/time-savers-code-beautifier-and-formatter/