A common usage case is have EurekaLog enabled only for production.
EurekaLog is a tool, designed to gather reports about issues from users of your application. Therefore, it can not use heavy debugging code to not slow down execution of your application too much. It means that using a local IDE debugger will usually be more convenient. That is why many developers prefer to use IDE's debugger during developing, and use EurekaLog only for production.
This article will discuss the case when you want to have EurekaLog enabled in one build configuration, but not in another. If you want EurekaLog to be enabled for both Debug and Release build configurations, but with different settings - please, see How to use different settings for development/production article instead.
Important Note: some features of EurekaLog can be automatically disabled if no debugger is present. For example, memory leaks and freeze/hang/deadlock detection. Therefore, if you are only interested in those features - you may not need to do anything at all. Just configure the features.
How to differentiate between development and production buildsDefault project configuration in modern IDEs has 3 build configurations defined:
The supposed meaning is using Debug build configuration for developing and using Release build configuration for production.
Default build configurations
You can also check current build configuration in your source code:
{$IFDEF DEBUG}
We recommend to follow that approach.
Important: you are supposed to configure Release build configuration for EurekaLog.
Note: if you are using old IDE without build configurations support - the alternative way would be to create two projects, which will include the same set of units and share the same project source (.dpr file). Assign one project to be a development project, and second project to be a production project. The example below would use modern IDE as an example.
Important: do not forget to make a full project rebuild (not just compile) when you have switched active build configuration.
How to disable EurekaLog for developingGo to Project / EurekaLog options (see also):
EurekaLog project options in IDE menu
Don't see EurekaLog menu items?
You should see the "General" page. Uncheck all checkboxes in "Build Configurations" list:
EurekaLog is disabled for the whole project
This will disable EurekaLog for the whole project. Now check only build configuration that you want to use with EurekaLog. E.g. Release:
EurekaLog is enabled only for production build configuration
Important:
If you want to learn more details - see Compiling with and without EurekaLog.
See also:
|