Need to wrap CodeSite calls in {$IFDEF DEBUG}

Have a CodeSite question that doesn't fit into any of the forums below? Post it here.

Need to wrap CodeSite calls in {$IFDEF DEBUG}

Postby qppstudio » Fri Apr 21, 2017 4:39 am

Hello,

Do I need to wrap all my calls to CodeSite.Send() in {$IFDEF DEBUG} blocks, if I do not want these calls in my release version ? I am asking because it seems that leaving the calls un-wrapped and simply not activating CodeSite does the job nicely.

Does the internal code of CodeSite just exit if it is called while not enabled with minor time wasted ?

Very best regards,

Olivier Beltrami
qppstudio
 
Posts: 2
Joined:
Wed Apr 19, 2017 1:44 pm

Re: Need to wrap CodeSite calls in {$IFDEF DEBUG}

Postby Raize Support » Sun Apr 23, 2017 11:50 pm

Hi Olivier,

Yes, all of the TCodeSiteLogger methods (the global CodeSite object is an instance of TCodeSiteLogger) check the logger's Enabled property as well as the CodeSiteManager.Enabled property and only continues if they are both Enabled.

Therefore, the recommended approach is to disable the CodeSite loggers and not wrap them in {$IFDEF DEBUG} blocks. The other benefit of this is that you can easily enabled the loggers should you need to capture any information in your production code.

Ray
Raize Software Support
Raize Software
http://www.raize.com
Raize Support
 
Posts: 603
Joined:
Fri Mar 25, 2011 9:04 pm

Re: Need to wrap CodeSite calls in {$IFDEF DEBUG}

Postby qppstudio » Mon Apr 24, 2017 7:28 am

Thank you very much.
Fantastic and highly addictive product.
qppstudio
 
Posts: 2
Joined:
Wed Apr 19, 2017 1:44 pm


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest