[open-ils-commits] r18457 - trunk/Open-ILS/src/reporter (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Oct 25 12:25:09 EDT 2010


Author: miker
Date: 2010-10-25 12:25:05 -0400 (Mon, 25 Oct 2010)
New Revision: 18457

Modified:
   trunk/Open-ILS/src/reporter/clark-kent.pl
Log:
Dump some debugging output from clark; may later make this optional, but we usually need it when looking for the cause of problems.

Modified: trunk/Open-ILS/src/reporter/clark-kent.pl
===================================================================
--- trunk/Open-ILS/src/reporter/clark-kent.pl	2010-10-25 15:15:49 UTC (rev 18456)
+++ trunk/Open-ILS/src/reporter/clark-kent.pl	2010-10-25 16:25:05 UTC (rev 18457)
@@ -449,6 +449,7 @@
 			th { background-color: lightgray; }
 			td,th { border: solid black 1px; }
 			* { font-family: sans-serif; font-size: 10px; }
+			.dim { color: lightblue; }
 		</style>
 	</head>
 	<body>
@@ -469,6 +470,24 @@
 	# add a link to the CSV output
 	push @links, "<a href='report-data.csv'>CSV Output</a>" if ($r->{csv_format});
 
+	# debugging output
+	push @links, "<a class='dim' href='report-data.html.debug.html'>Debugging Info</a>";
+
+	my $debug = new FileHandle (">$file.debug.html") or die "Cannot write to '$file.debug.html'";
+	print $debug "<html><head><title>DEBUG: $$r{report}{name}</title></head><body>";
+
+	{	no warnings;
+		print $debug '<h1>Generated SQL</h1><pre>' . $r->{resultset}->toSQL() . "</pre><a href='$file'>Back to output index</a><hr/>";
+		print $debug '<h1>Template</h1><pre>' . Dumper( OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{template}->{data} ) ) . "</pre><a href='$file'>Back to output index</a><hr/>";
+		print $debug '<h1>Report Parameter</h1><pre>' . Dumper( OpenSRF::Utils::JSON->JSON2perl( $r->{report}->{data} ) ) . "</pre><a href='$file'>Back to output index</a><hr/>";
+		print $debug '<h1>Report Run Time</h1><pre>' . $r->{resultset}->relative_time . "</pre><a href='$file'>Back to output index</a><hr/>";
+		print $debug '<h1>OpenILS::Reporter::SQLBuilder::ResultSet Object</h1><pre>' . Dumper( $r->{resultset} ) . "</pre><a href='$file'>Back to output index</a>";
+	}
+
+	print $debug '</body></html>';
+
+	$debug->close;
+
 	print $index join(' -- ', @links);
 	print $index "$br4</center>";
 



More information about the open-ils-commits mailing list