Root > Advanced topics > Working with EurekaLog settings > Reconfiguring EurekaLog for manual control

Reconfiguring EurekaLog for manual control

Previous pageReturn to chapter overviewNext page   

Important Note: Be extra careful when doing batch compilation of projects in project groups, or using external build tools. There are IDE bugs and other issues, which may pass incorrect information to EurekaLog (via OpenTools API in case of IDE). Pay close attention which configuration file is passed to compilers by external build tools. Always double-check the final executables.


This article will discuss how you can control EurekaLog manually - without assistance of IDE expert. This may be useful if you want to use EurekaLog without IDE expert installed, if you want consistent behavior between IDE and your build tool, or for any other reason.



Step 1: get working solution for single build configuration

First, we create a new VCL application and place a button to raise exception. Then go to Project/EurekaLog options, enable EurekaLog and specify type of this application (VCL Forms). You can also set other options as you desire. Now run the application and confirm it's working as expected.



Step 2: reconfigure project for manual control


A: Creating options

For the next step you should go to "Project" / "EurekaLog options" and use "Export" button to create .eof file. Place it in the same folder as your project (by default "Profiles" folder is suggested, switch to your project's folder). Name it as you like. For example: Project1_Custom_Config.eof.


B: Disable IDE assist

Now, don't close options dialog, but go to "Advanced" / "Custom/Manual" and add "DoNotTouch=1" line (without quotes) in any place (as new line). This will disable any assist for your project from IDE expert. Close settings and save your project.


Note: do not add "DoNotTouch=1" line to configuration created on step A above.


You can confirm if option is taking effect by disabling EurekaLog, saving your project and observing that there are no changes in your .dpr file - all units are still included even if no EurekaLog is enabled.


Note: EurekaLog also supports "DoNotTouchCompilation", "DoNotTouchOptions", "DoNotTouchUnits", and "DoNotTouchPackages" options for more precise control over options. Set "DoNotTouch" option to completely disable EurekaLog assist for the project; or set one or several "DoNotTouchXYZ" options. "DoNotTouchCompilation" option disables post-processing assist. Enable this option if you intend to invoke ecc32/emake manually. "DoNotTouchOptions" disables modification of project options and defines. Enable this option if you want to manage project options manually. "DoNotTouchUnits" disables modification of units in uses clause. Enable this option if you want to manually manage your units. "DoNotTouchPackages" option disables modifications in run-time packages list.


Alternatively, you may simply disable/remove EurekaLog IDE expert.


C: Setting up post-processing

Now, it's time to restore post-processing for your application. Go to "Project" / "Options" (not EurekaLog options) and look for build events options.


Add the following command as pre-build event which is invoked before compilation:


IF EXIST "C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Packages\Studio16\ecc32.exe" 

"C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Packages\Studio16\ecc32.exe" 




Add the following command as post-build event which is invoked after successful compilation:


IF EXIST "C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Packages\Studio16\ecc32.exe" 

"C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Packages\Studio16\ecc32.exe" 





Both command lines are broken into several lines for readability. Do not break into lines when entering command-line to pre/post-build events in IDE;
Replace "C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\" folder with real EurekaLog installation path on your machine;
Replace "Studio16" with corresponding name for your IDE;
Replace "Project1" with your real project name;
You can find the IDE's $(Config) and $(Platform) variables useful. $(Config) will be replaced with build configuration name - such as Debug and Release. $(Platform) will be replaced with short name of the platform - such as Win32, Win64, OSX. So you can have file like Project1_Win32_Debug.eof and use "--el_config=Project1_$(Platform)_$(Config).eof" switch.


So, the resulting command-line may look like this when run:


IF EXIST "C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Packages\Studio16\ecc32.exe" 

"C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Packages\Studio16\ecc32.exe" 




Note that this is an example of final command as it will be executed by IDE. You should NOT use this form of command (with already expanded variables) - please use the first example with $(...) variables.


D: Check that everything works

Now compile your project and run it. If you have done everything correctly - the result must be the same as on step 1: the correct EurekaLog-enabled application with expected behavior as set in external .eof file (even though the EurekaLog was disabled in project).


In case of any build errors - take a look at compiler output as shown in "Messages" window. It's docked at the bottom of IDE window by default. "Output" tab is near "Build" tab, which is active by default. If you don't see "Messages" window - use View/Messages command to show it, then switch to output window. The correct compilation will get you such messages:


Build started 2012.06.29 16:58:04.


Project "C:\Projects\Project1.dproj" (Build target(s)):

Target _PasCoreCompile:

   C:\program files (x86)\embarcadero\rad studio\8.0\bin\dcc32.exe //-- options cut to save space --// Project1.dpr  

Target PostBuildEvent:

   IF EXIST "C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Packages\Studio16\ecc32.exe" "C:\Program Files (x86)\Neos Eureka S.r.l\EurekaLog 7\Packages\Studio16\ecc32.exe" "--el_alter_exe=C:\Projects\Project1.dproj;.\Debug\Win32\Project1.exe" "--el_config=Project1_Custom_Config.eof"

   EurekaLog Command-Line Compiler v7.0.1.0 for Delphi 15.0



   Loading EurekaLog options...

   EurekaLog postprocessor start...

   EurekaLog's code was added

   EurekaLog's options were added

   EurekaLog's data was added

     File size before:     2'159'616

     File size after:      2'185'216

     File size diff:       +25'600

     Debug info size:      287'554

     Symbols size:         58

     Functions size:       4

     Stripped size:        -138'240

     Number of units:      209

     Number of procedures: 10'136

     Number of lines:      28'124

     Total time:           00:00:00.639

       Compilation time:   00:00:00.026

       Prepare time:       00:00:00.015

       Post-process time:  00:00:00.597

       Events time:        00:00:00.001

     Memory usage:

       Allocated:          7'576'806

       RAM:                29'999'104

       Private:            27'066'368

       Virtual:            105'299'968

   EurekaLog postprocessor end

Build succeeded.

   0 Warning(s)

   0 Error(s)

Time Elapsed 00:00:01.91



Step 3: [optional] configuring alternative build configurations

Finally, you may create any number of additional build configurations. The first thing you need to do - is to decide if you want EurekaLog for this build configuration or not. The difference is that you need different project options set for different cases. As well as different unit set.


First, conditional directives. Go to "Project" / "Options" and look to "Delphi Compiler" / "Conditional Defines" option. Now, if you want EurekaLog for this build configuration - add EUREKALOG conditional symbol. If you don't want EurekaLog for this build configuration - remove EUREKALOG conditional symbol. Repeat this step for each build configuration of your project that you're going to use.


Second, the options of the project. EurekaLog requires certain options to be set in order to work. Also, some option may increase or decrease detalization of EurekaLog. So, if you want to use EurekaLog in certain build configuration - then you have to setup all required options manually. Please, read this article to know what options must be set. For other build configurations (in which EurekaLog will not be used) you can set options as you desire, there are no limitations.


Third, included units - those will be handled by --el_prepare switch which is used above.


Fourth, you have to create .eof file for each build configuration and save it with corresponding name.


At last - make sure that pre/post-build events that we set in options at previous step are applied for all build configurations (you can do this by entering command to Base build configuration and checking that it wasn't overwritten in other build configurations).



You can use EBase unit to test whenever EurekaLog was enabled for your application or not. This unit is specially designed to be included in any application without including full EurekaLog's code.


Now, do a test - switch to different build configurations, make a build, run application and test it.


Important Note: it's recommended to make a full rebuild when changing build configuration or target platform.




This article explained the basics of manual control over configuration of your project.


As a side note - let's discuss relation between settings and build configurations names:

In classic application: the Debug build configuration has maximum debug options set, and the Release build configuration has minimum debug options set (most debug options are disabled).
It's different for applications with exceptions tracers. Exception tracer requires more info than you usually use for debugging sessions (think about "Use Debug DCUs" option). So typically it's reversed now: you want maximum options for Release version of your application and medium (moderate) options for debugging. Therefore, you can either swap build configurations (i.e. use "Debug" build configuration for the release version of your application) or to completely re-setup options between build configurations.



See also:

Send feedback... Build date: 2022-03-28
Last edited: 2022-01-17
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.

Permanent link to this article: