Search Results cln_debug_pub




Overview

CLN_DEBUG_PUB is a public PL/SQL package body owned by the APPS schema that provides a centralized debugging and diagnostic logging framework within Oracle E-Business Suite Release 12.1.1 and 12.2.2. The package belongs to the "CLN" (Oracle Contracts) product family and is classified as a public API, meaning it is intended for invocation by other application code rather than being restricted to internal use. Its core business function is to allow developers and support engineers to instrument PL/SQL code with conditional debug output, capturing diagnostic messages that can be stored, buffered, and later retrieved for analysis. Because it is referenced by 42 other packages, CLN_DEBUG_PUB functions as shared infrastructure rather than a standalone utility, enabling consistent, controlled diagnostic logging across a broad set of dependent modules without each module reimplementing its own logging logic.

Key Procedures and Functions

The documented interface exposes fourteen procedures and functions. The following are explicitly enumerated in the metadata:

  • SET_DEBUG_MODE — Establishes the overall debug state for the session or execution context, enabling or disabling diagnostic capture.
  • INITIALIZE — Prepares the package's internal state, buffers, and index pointers for a debugging session.
  • DEBUG_ON — Activates debug logging so subsequent debug messages are captured.
  • DEBUG_OFF — Deactivates debug logging, suppressing further capture.
  • ISDEBUGON — Returns whether debugging is currently active, allowing callers to avoid expensive message construction when logging is disabled.
  • GETDEBUGCOUNT — Returns the number of debug messages accumulated in the buffer.
  • ADD — Appends a debug message to the internal buffer, forming the primary logging entry point.
  • GETFIRST — Positions retrieval at the first buffered debug message.
  • GETNEXT — Advances to and returns the next buffered debug message.
  • GETNEXTBUFFER — Retrieves the next block or buffer segment of debug content.
  • RESETINDEX — Resets the internal retrieval index so iteration can restart from the beginning.
  • SETDEBUGLEVELFROMPROFILE — Derives the active debug level from an Oracle EBS profile option, allowing debug verbosity to be governed centrally by configuration.
  • SETDEBUGLEVEL — Sets the debug level directly, controlling the granularity of messages captured.

Together these routines implement a producer-consumer model: callers use ADD to write messages, and iteration functions (GETFIRST, GETNEXT, GETNEXTBUFFER, RESETINDEX) read them back. Parameter lists are not documented in the metadata and are therefore not reproduced here.

Tables Accessed

CLN_DEBUG_PUB references several underlying objects, accessed via APPS synonyms. CLN_DEBUG_S is the primary persistent store for debug records, holding captured messages across sessions. DUAL is used for trivial single-row SQL evaluation, such as confirming state or returning constants. PLITBLM is a standard Oracle-supplied PL/SQL table type used for in-memory buffering of message collections. UTL_FILE is the Oracle-supplied file I/O package, indicating that debug output may optionally be written to server-side operating system files. The package also depends on FND_API, FND_FILE, FND_GLOBAL, and FND_PROFILE. FND_PROFILE is particularly significant because SETDEBUGLEVELFROMPROFILE reads profile option values from it to determine the active debug level.

Usage Notes

CLN_DEBUG_PUB is typically invoked from custom PL/SQL code, concurrent programs, and Oracle Forms logic that require controlled diagnostic output. A common pattern is to call SETDEBUGLEVELFROMPROFILE or SETDEBUGLEVEL during initialization, guard expensive message construction with ISDEBUGON, append messages through ADD, and then flush buffered content via the GETFIRST/GETNEXT/GETNEXTBUFFER iteration sequence. Because the package depends on FND_PROFILE, debug verbosity can be toggled per user, responsibility, or site without code changes. Its role as a dependency of 42 other packages confirms that it is foundational infrastructure within the Contracts modules, and developers instrumenting those modules should use this package rather than introducing ad hoc logging to preserve consistency and respect the configured debug levels.