Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.140.2.10 -r1.140.2.11 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 10 Oct 2015 20:16:23 -0000 1.140.2.10 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 11 Oct 2015 17:35:21 -0000 1.140.2.11 @@ -4708,7 +4708,29 @@ return $result } +ad_proc -public ad_log { + level + message +} { + Output ns_log message with detailed context. This function is + intended to be used typically with "error" to ease debugging. + + @param level Severity level such as "error" or "warning". + @param message Log message + @author Gustaf Neumann +} { + set prefix "" + if {[ns_conn isconnected]} { + set headers [ns_conn headers] + append prefix \ + [ns_conn method] \ + " http://[ns_set iget $headers host][ns_conn url]?[ns_conn query]" \ + " referred by '[get_referrer]'\n" + } + ns_log $level "${prefix}${message}\n[uplevel ad_get_tcl_call_stack]" +} + # Local variables: # mode: tcl # tcl-indent-level: 4