better debugging

This commit is contained in:
JT Smith 2006-04-27 22:16:13 +00:00
parent 6b77047cde
commit 7e6268df8c
2 changed files with 8 additions and 5 deletions

View file

@ -17,8 +17,8 @@ package WebGUI::Session::ErrorHandler;
use strict;
use Log::Log4perl;
use Data::Dumper;
use Apache2::RequestUtil;
use JSON;
=head1 NAME
@ -397,14 +397,19 @@ sub showDebug {
my $text = $self->session->stow->get('debug_error');
$text =~ s/\n/\<br \/\>\n/g;
my $output = '<div style="text-align: left;background-color: #800000;color: #ffffff;">'.$text."</div>\n";
$text = $self->session->form->paramsHashRef();
$output .= '<div style="text-align: left;background-color: #ffffff;color: #000000;"><pre>Form Variables:'.Dumper($text)."</pre></div>\n" if(scalar(keys %{$text}));
$text = $self->session->stow->get('debug_warn');
$text =~ s/\n/\<br \/\>\n/g;
$output .= '<div style="text-align: left;background-color: #ffdddd;color: #000000;">'.$text."</div>\n";
$text = $self->session->stow->get('debug_info');
$text =~ s/\n/\<br \/\>\n/g;
$output .= '<div style="text-align: left;background-color: #ffffdd;color: #000000;">'.$text."</div>\n";
$text = JSON::objToJson($self->session->form->paramsHashRef(), {pretty=>1, indent=>4});
$text =~ s/&/&amp;/xsg;
$text =~ s/>/&gt;/xsg;
$text =~ s/</&lt;/xsg;
$text =~ s/\n/\<br \/\>\n/g;
$text =~ s/ /&nbsp; &nbsp; /g;
$output .= '<div style="text-align: left;background-color: #cccccc;color: #000000;">'.$text."</div>\n";
$text = $self->session->stow->get('debug_debug');
$text =~ s/\n/\<br \/\>\n/g;
$output .= '<div style="text-align: left;background-color: #dddddd;color: #000000;">'.$text."</div>\n";

View file

@ -247,8 +247,6 @@ foreach my $filename (keys %config) {
my $dumpcmd = $config{$filename}{mysqlDump} || $mysqldump;
my $backupTo = $config{$filename}{backupPath} || $backupDir;
mkdir($backupTo);
print ("sql:".$upgrade{$config{$filename}{version}}{sql}."\n");
print ("pl:".$upgrade{$config{$filename}{version}}{pl}."\n");
while ($upgrade{$config{$filename}{version}}{sql} ne "" || $upgrade{$config{$filename}{version}}{pl} ne "") {
my $upgrade = $upgrade{$config{$filename}{version}}{from};
unless ($skipBackup) {