http://inogic.blogspot.ca/2011/01/use-tracing-in-crm-2011-plugins.html shows how to the plugin execution.
My question is: Do I have to remove the tracing related code when I move it to production? Or is it controlled by some flag that can get turned on and off as need arises?
There is no configurable control of tracing. If you do not wish to continue tracing in Production the code must be removed.
If you want code to be compiled into your Debug (for Dev/Test etc) version, but not Release, you can use the DEBUG pragma to conditionally compile the tracing code:
When you change your build to Release (which does not define the DEBUG pragma, your assembly will no longer contain the tracing.
--pogo (pat) @ pogo69.wordpress.com