Search Results ec_debug




Overview

APPS.EC_DEBUG is a diagnostic utility package belonging to the Oracle E-Business Suite ETRM (Engineering/Telecom) product family. Its sole business function is to provide a centralized, reusable debugging and tracing facility for PL/SQL code executed inside concurrent programs and related server-side processes. When enabled, the package writes detailed, timestamped, and indented trace messages into the log or report file of the invoking concurrent request, allowing administrators and support analysts to reconstruct the execution path of a program that has failed or produced unexpected results. The package is classified as OTHER in the ETRM API registry, indicating it is an internal helper rather than a public business API. It is referenced by 38 other packages, confirming it is a foundational instrumentation layer used broadly across the ETRM codebase. The header comment (ECDEBUGB.pls 120.2) shows the file has been stable since at least 2005, with the current implementation carried forward unchanged into the 12.1.1 and 12.2.2 releases.

Key Procedures and Functions

The package exposes thirteen documented procedures and functions. The core control procedures are:

  • ENABLE_DEBUG — Sets the global debug level, accepting an optional level argument defaulted to 0. This activates message emission for the session.
  • DISABLE_DEBUG — Resets the debug level to 0 and deletes the program stack, terminating all tracing for the session.
  • PUSH — Records the name of a program or routine and its start timestamp onto an internal stack, emitting an "Enter" trace line. It is guarded so that the message is only written when the debug level is at least 2 (a fix introduced under Bug 1853627 to suppress noise at lower levels).
  • POP — Removes the most recent entry from the program stack, typically paired with PUSH to bracket the execution of a routine.
  • INDENT_TEXT — Produces the leading whitespace used to visually align trace output according to stack depth; it is the routine referenced by the indent_text search term and by the SPLIT and PUSH implementations.
  • SPLIT — Breaks long messages into fixed-length chunks and writes each chunk to FND_FILE.LOG, prefixing it with INDENT_TEXT(0). An exception handler routes failures to EC_DEBUG.PL with SQLCODE and SQLERRM.
  • PL — The primary low-level logging routine, used for emitting named messages and error details.
  • FIND_POS — A string-search helper used internally to locate positions within message text.

Tables Accessed

The only documented table reference is PLITBLM, accessed through an APPS synonym. PLITBLM is the standard Oracle database internal view used to read PL/SQL inter-language debug information and is commonly used by diagnostic utilities to resolve line numbers and object names for error traces. No application data tables are read or written by this package; all other state is held in package globals such as G_debug_level and G_program_stack, which live only for the duration of the session.

Usage Notes

EC_DEBUG is never invoked directly by end users. It is called from within other ETRM packages, concurrent program PL/SQL bodies, and custom extensions where tracing is required. Typical usage is to call ENABLE_DEBUG at the start of a program, wrap significant steps in PUSH/POP pairs, emit messages through PL or SPLIT, and call DISABLE_DEBUG on completion. Because trace output is directed to FND_FILE.LOG, results are reviewed through the standard "View Log" action on the concurrent request. The level-based gating means that routine entry/exit traces only appear at debug level 2 or higher, so support staff should confirm the appropriate level is set before collecting diagnostics. When adapting the package for custom code, the documented signatures should be treated as fixed; parameter lists are not to be altered, since 38 dependent packages assume the current interface.