Databases Reference
In-Depth Information
programmatically. In this section we'll examine the APIs and see how they can be put to use in an
application context.
APEX_DEBUG_MESSAGE
The core debugging API exists in the form of the APEX_DEBUG_MESSAGE package. This package is
fairly undocumented and, at the time of writing, does not appear in the API reference nor does any
mention of it appear in the APEX Developers Guide. Following is brief documentation of the individual
procedures that appear in the API. We'll discuss their usage further in later sections.
ENABLE_DEBUG_MESSAGES Procedure
This procedure allows the developer to programmatically enable debugging in the context of the current
phase of page processing.
Syntax
procedure enable debug messages (p level in number default 7);
Parameters
p_level: Level of debug messages to log
Usage Notes
Level 1 is the most important.
Level 7 is the least important.
Setting p_level to 3 would log any message at level 1, 2 and 3.
Enabling Debug programmatically is not limited by the application level setting that disallows
interactive debugging. Therefore, even if the application is set to disallow interactive debugging,
programmatic debugging will still work as expected.
The earliest points in an APEX page where debugging can be programmatically enabled are as
follows:
PAGE RENDERING : You may create a Branch of type Branch to PL/SQL Procedure with a
processing point of On Load: Before Header making sure that the sequence number of the
process is the lowest in the set.
PAGE PROCESSING : You may create a Process of type PL/SQL Anonymous Block with a
processing point of On Submit - Before Computations and Validations making sure that the
sequence number of the process is the lowest in the set.
When debugging is programmatically enabled via the API, APEX will not emit the debug message
that indicates the phase (i.e., SHOW or ACCEPT). Therefore it is good practice to use the
LOG_MESSAGE procedure to output a message immediately after debug that will help you to
identify the phase. For example, the following code snippet could be placed in an On Load page
process to programmatically enable debug and immediately emit a message indicating the phase:
Search WWH ::




Custom Search