Hello I am working on a Server Application that is multithreaded having a control panel form and a console for the output. I am using log by console output. For Enabling log I compile the version with log and for disabling log I compile the version without log. This is handled as I use all code is between the lines.
#if Enable_DEBUG_ECHO
Console.WriteLine("Something is happening");
#endif
so I if use #define Enable_DEBUG_ECHO
on top of file it compiles for echo. But I want implement a option by which user can enable/disable log by single click or something like that. Somebody give me the idea how can I do this.
You can use a logging framework such as NLog or log4net, that makes all this so easy. You can configure them programatically or through configuration files.