ad_log (public)
ad_log level [ args... ]
Defined in packages/acs-tcl/tcl/utilities-procs.tcl
Output ns_log message with detailed context. This function is intended to be used typically with "error" to ease debugging. Repeated messages are reported only once, with a reference to the first occurrence.
- Parameters:
- level (required)
- Severity level such as "error" or "warning".
- Author:
- Gustaf Neumann
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_folder_with_page, create_workflow_with_instance, create_form_with_form_instance
Source code: # # ad_log gathers request information, which may itself encounter an # error and call ad_log. In that case, log without gathering context. # if {[info exists ::acs::ad_log_in_progress]} { ns_log $level {*}$args "\n recursive ad_log invocation; request context omitted" return } set ::__ad_log_in_progress 1 try { set with_headers [expr {$level in {error Error}}] append request " " [util::request_info -with_headers=$with_headers] ns_log $level {*}$args "\n[uplevel ad_get_tcl_call_stack]${request}\n" # # Optional deduplication.. not sure this should be done # always. Better to get rid of the error/warning # # set key $level-$args # if {[nsv_get ad_log $key previous_thread_name]} { # set cnt [nsv_incr ad_log $key-count] # ns_log notice # "... repeated $level #$cnt (see $previous_thread_name)" # } else { # nsv_set ad_log $key [ns_thread name] # set with_headers [expr {$level in {error Error}}] # set request "" # append request " " # [util::request_info -with_headers=$with_headers] # # ns_log $level {*}$args # "\n[uplevel ad_get_tcl_call_stack]${request}\n" # } } finally { unset -nocomplain ::__ad_log_in_progress }XQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/utilities-procs.xql