Index | Installation | Introduction | API Overview | Package Console | Changelog | Uninstallation
For a more detailed overview of the public API methods including examples please see the package console methods. You can also use the links on the method names below.
The console API is inspired by the JavaScript Console API. This means, we have mostly the same log levels and method names. The parameters differs a little bit to fit our needs in PL/SQL. Not all methods making sense in a PL/SQL instrumentation tool (we have no direct screen) and therefore these six are not implemented: clear, dir, dirxml, group, groupCollapsed, groupEnd. We use snake case instead of camel case for readability. As table is a keyword in SQL we named our method table#. The log level verbose is splitted into debug and trace.
We have five log levels:
- Level 1: Error
- Level 2: Warning
- Level 3: Info
- Level 4: Debug (instead of verbose in JS console)
- Level 5: Trace (not existing in JS console)
Log entries are saved in a table: select * from console_logs
The main instrumentation methods:
- console.error_save_stack:
Does only save the current scope in an internal stack until the
error
procedure is called which outputs then the saved stack. This is possibly the most powerful feature which can save you useless log entries from nested methods. You need only to callconsole.error
in the outermost method of you logic and you don't loose details. - console.error (level error)
- console.warn (level warning)
- console.info & log (level info)
- console.debug (level debug)
- console.trace (level trace)
- console.count & count_reset
- console.count_current & count_end (level info)
- console.count_current & count_end (function overloads, independent of log level)
- console.time & time_reset
- console.time_current & time_end (level info)
- console.time_current & time_end (function overloads, independent of log level)
- console.table# (level info)
- console.assert & assertf
- console.format
- console.add_param (also see generate_param_trace for code generation)
Additional instrumentation methods:
- console.action & module: Aliases for dbms_application_info.set_action and set_module to be friendly to the DBA and monitoring teams. The module is usually set by the application (for example APEX is setting the module, and often also the action).
- console.apex_error_handling: Log internal APEX errors (only available, if APEX is installed, also see the APEX docs).
- console.apex_plugin_render & apex_plugin_ajax: Methods for the APEX plugin (only available, if APEX is installed).
Additional methods to manage logging mode of sessions and to see the current status of the package console:
- console.conf
- console.init & exit & exit_all
- console.my_client_identifier & my_log_level
- console.level_is_warning & level_is_warning_yn
- console.level_is_info & level_is_info_yn
- console.level_is_debug & level_is_debug_yn
- console.level_is_trace & level_is_trace_yn
- console.version
- console.status
Additional housekeeping methods:
- console.purge & purge_all
- console.purge_job_create & purge_job_run & purge_job_disable & purge_job_enable & purge_job_drop
Additional helper methods (mostly used by console internally) which might also helpful for you:
- console.clob_append & clob_flush_cache
- console.runtime & runtime_seconds & runtime_milliseconds
- console.print & printf
- console.split_to_table & split & join
- console.to_yn & to_string & to_bool
- console.to_html_table
- console.to_md_tab_header & to_md_tab_data
- console.to_unibar
- console.level_name
- console.scope & call_stack
- console.apex_env & cgi_env & console_env & user_env