user1556433
user1556433

Reputation:

Delphi Compiler Warning: Unit 'ExceptionLog' is deprecated

I am using EurekaLog 7 Professional in my Delphi application. While migrating from Delphi 7 to Delphi XE4, I am getting the following compiler warning.

[dcc32 Warning] myproject.dpr(4): W1006 Unit 'ExceptionLog' is deprecated

How should I get rid of this warning?

Upvotes: 1

Views: 1736

Answers (1)

David Heffernan
David Heffernan

Reputation: 613592

The answer to such questions is always that you need to remove references to the named unit and replace them with references to its replacement.

In this case the EurekaLog KB article that is the first hit on a web search for your error message gives all the details:

Problem:

I get "Unit 'ExceptionLog' is deprecated" error when compiling my application. However, when I try to remove this unit - I get many "undeclared identificator" errors.

Reason:

ExceptionLog unit is unit from EurekaLog 6. It's included in EurekaLog 7 to import old EurekaLog 6 applications. However, it was marked as "deprecated" to indicate that your application uses old code (i.e. code from EurekaLog 6).

EurekaLog 7 uses ExceptionLog7 unit instead (and additional units - see below).

Solution:

Please note that this message is not error. Your application will be compiled and run. It will function properly. This message is a warning. A warning that notify you that your project uses old code.

It's perfectly fine to use ExceptionLog unit in your application. If you have old EurekaLog project and then you upgrade EurekaLog to version 7 and import your project - it will be imported in compatibility mode and ExceptionLog unit will be used. Now you can recompile your application and it should work as before. Almost no code change is required.

If you don't want to see warnings about unit being deprecated - you can either turn off these notification in project options or use $WARN UNIT_DEPRECATED ON/OFF directives to selectably turn these warnings messages on/off for parts of your code.

However, if you want to upgrade your code, then you must disable compatiblity mode and replace ExceptionLog references with references to ExceptionLog7 unit. Also, when you start a new project - then you will use new units by default (since there is no already written code).

Note that EurekaLog 7 is a major re-design of EurekaLog 6. EurekaLog 6 contains almost everything in one single unit (ExceptionLog), while EurekaLog 7 split code into several units (such as ECallStack, EModules, ESysInfo, EExceptionManager, EDebugInfo, ESend, EDialog, etc.). That's why you may need to additionally include other units to your uses clause. If you get "undeclared identificator" error - then some unit is missing from uses. You can run a file search in \Source folder of EurekaLog installation for *.pas files containing your missed identificator (this will work also for editions without full source code, as they contain headers). Alternatively, you may study changes in EurekaLog 7.

Upvotes: 6

Related Questions