mirror of
https://github.com/EiffelSoftware/eiffel-org.git
synced 2025-12-07 15:22:31 +01:00
git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1942 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
30 lines
1.0 KiB
Plaintext
30 lines
1.0 KiB
Plaintext
[[Property:title|Using debug clauses]]
|
|
[[Property:weight|5]]
|
|
[[Property:uuid|78e0273d-525e-a338-dfe4-d5fc27cd06d3]]
|
|
Eiffel provides ways to add debug code to features to help during their debugging. You may think of it as the well-known C construct: <code></code>
|
|
|
|
<code lang=c>#ifdef MY_DEBUG_FLAG/* Debug code is here */ #endif</code>
|
|
|
|
|
|
The corresponding construct in Eiffel is provided by the debug keyword. It is possible to wrap code inside a debug clause like this:
|
|
<code></code>
|
|
<code>
|
|
debug("MY_DEBUG_FLAG")
|
|
-- Debug code is here.
|
|
end</code>
|
|
|
|
|
|
It is then possible to enable or disable debug clauses globally.
|
|
|
|
To modify the debug clauses status:
|
|
* Open the [[Debug Options|Project Settings]] dialog.
|
|
* In the '''Debug''' section, you can enable/disable the debug clauses.
|
|
* Click '''OK'''.
|
|
* You must [[Generating executables|recompile]] your project for the changes to take effect.
|
|
|
|
{{tip|Debug clauses make it easy to remove all debug messages when finalizing a system. }}
|
|
|
|
|
|
|
|
|