Destination.Viewer.Active, False but Live Logger still opens

CodeSite logging interface classes: default "CodeSite" logger, T|CodeSiteLogger class, destinations, formatters, etc.

Destination.Viewer.Active, False but Live Logger still opens

Postby ToddFlora » Wed May 01, 2013 8:28 pm

Hi,

Let me first say, Ray. This product is awesome I am loving Code Site.

Just another question that I can't seem to figure out.

I have several loggers one for each unit in my Delphi Application. I Initialize them in the Initialization section of the unit they are for and do not make them active unless the user turns them on via a dialog in the application.
I also set Create a destination for the CodeSite Logger which I categorize as system and define a log file, as well as make the Viewer.Active property false. That way on a dev machine where the viewer is installed it will not pop up and annoy the developer.

When CodeSite.Enter/Exit/Send is called the viewer does not popup and all is good, On the other hand when one of my other loggers enters/exits or Sends, the viewer does popup if installed. I was under the impression in the docs that if I did not define a destination for each logger that they would use the CodeSite destination. I do see this happening in that my log file is written to by all loggers, but for some reason the unit level loggers are not recognizing Viewer.Active = False from the CodeSite.Destination.

Am I missing something here or am I supposed to do something else to stop the unit level loggers from opening up the Live Viewer?

Thanks for all your Help.

Todd.
ToddFlora
 
Posts: 11
Joined:
Sat Nov 24, 2012 5:24 am

Re: Destination.Viewer.Active, False but Live Logger still o

Postby Raize Support » Thu May 02, 2013 10:49 pm

Hi Todd,

Thanks for the feedback, we appreciate it. Now on to your question.

By default no TCodeSiteLogger instance, including the global instanced named CodeSite, has a destination assigned to its Destination property. In this situation, when a logger's Destination is nil, the logger uses the destination that has been assigned to the CodeSiteManager.DefaultDestination property. By default, the CodeSiteManager.DefaultDestination property has Viewer.Active := True.

In your example, it sounds like you have created a custom TCodeSiteDestination object and assigned it to the CodeSite.Destination property. This means that the CodeSite instance will use this destination, but all of your other logger instances are still going to use the CodeSiteManager.DefaultDestination destination. This is why the Live Viewer keeps popping up.

If you want to have all loggers use your custom destination, assign it to the CodeSiteManager.DefaultDestination property instead of CodeSite.Destination.

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

Re: Destination.Viewer.Active, False but Live Logger still o

Postby ToddFlora » Thu May 09, 2013 1:34 pm

Yes, I knew I was doing something wrong. Thanks Again Ray.

Todd.
ToddFlora
 
Posts: 11
Joined:
Sat Nov 24, 2012 5:24 am


Return to Loggers

Who is online

Users browsing this forum: No registered users and 1 guest

cron