Name

debug — send messages to debug log

ATTRIBUTES

Attribute Pos. Req. Default Description
interpolate     0 interpolate input?
reparse     1 interpolate output?
hide     0 Hide the tag return value?

DESCRIPTION

The tag sends a message to Interchange debug log.

BEHAVIOR

This tag does not appear to be affected by, or affect, the rest of Interchange.

EXAMPLES

Example: Sending a message to debug log

[debug] There are [nitems] items in session [data session id] [/debug]

NOTES

Debugging must be enabled for the tag to produce any noticeable effect; see debug glossary entry.

AVAILABILITY

debug is available in Interchange versions:

4.6.0-5.9.0 (git-head)

SOURCE

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: 1773

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{catalog} = $Vend::Cat;
      if($tpl =~ /\{caller\d+\}/i) {
          my @caller = caller();
          for(my $i = 0; $i < @caller; $i++) {
              $debug{"caller$i"} = $caller[$i];
          }
      }
  $debug{message} = errmsg(@_);

  $msg = Vend::Interpolate::tag_attr_list($tpl, \%debug, 1);
}
else {
  $msg = caller() . ":debug: " . errmsg(@_);
}

if ($Global::SysLog) {
  logGlobal({ level => 'debug' }, $msg);
}
else {
  print $msg, "\n";
}

return;
}

AUTHORS

Interchange Development Group

SEE ALSO

comment(7ic)

DocBook! Interchange!