debug — send messages to debug log
| Attribute | Pos. | Req. | Default | Description |
|---|---|---|---|---|
| interpolate | 0 | interpolate input? | ||
| reparse | 1 | interpolate output? | ||
| hide | 0 | Hide the tag return value? |
Example: Sending a message to debug log
[debug] There are [nitems] items in session [data session id] [/debug]
Debugging must be enabled for the tag to produce any noticeable effect; see debug glossary entry.
Interchange 5.9.0:
Source: code/SystemTag/debug.coretag
Lines: 13
# Copyright 2002-2007 Interchange Development Group and others # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. See the LICENSE file for details. # # $Id: debug.coretag,v 1.4 2007-03-30 23:40:49 pajamian Exp $ UserTag debug hasEndTag UserTag debug Interpolate UserTag debug Version $Revision: 1.4 $ UserTag debug MapRoutine Vend::Util::logDebug
Source: lib/Vend/Util.pm
Lines: 1766
sub logDebug {
return unless $Global::DebugFile;
if(my $re = $Vend::Cfg->{DebugHost}) {
return unless
Net::IP::Match::Regexp::match_ip($CGI::remote_addr, $re);
}
if(my $sub = $Vend::Cfg->{SpecialSub}{debug_qualify}) {
return unless $sub->();
}
my $msg;
if (my $tpl = $Global::DebugTemplate) {
my %debug;
$tpl = POSIX::strftime($tpl, localtime());
$tpl =~ s/\s*$//;
$debug{page} = $Global::Variable->{MV_PAGE};
$debug{tag} = $Vend::CurrentTag;
$debug{host} = $CGI::host || $CGI::remote_addr;
$debug{remote_addr} = $CGI::remote_addr;
$debug{request_method} = $CGI::request_method;
$debug{request_uri} = $CGI::request_uri;
$debug{catalog} = $Vend::Cat;
if($tpl =~ /\{caller\d+\}/i) {
my @caller = caller();
for(my $i = 0; $i < @caller; $i++) {
$debug{"caller$i"} = $caller[$i];
}
}
$tpl =~ s/\{session\.([^}|]+)(.*?)\}/
$debug{"session_\L$1"} = $Vend::Session->{$1};
"{SESSION_\U$1$2}"
/iegx;
$debug{message} = errmsg(@_);
$msg = Vend::Interpolate::tag_attr_list($tpl, \%debug, 1);
}