--- trunk2/lib/WebPAC/jsFind.pm 2004/07/21 16:18:45 390 +++ trunk2/lib/WebPAC/jsFind.pm 2004/09/14 21:02:28 445 @@ -4,7 +4,7 @@ use strict; use Carp; -use jsFind; +use jsFind 0.04; use Log::Log4perl qw(get_logger :levels); =head1 NAME @@ -26,6 +26,7 @@ my $index = new WebPAC::jsFind( index_path => '/path/to/jsFind/index', keys => 10, + log => 'log4perl.conf', ); C is path to location where jsFind index should be created. @@ -33,6 +34,9 @@ C is optional parametar which specify number of keys in each node (which has to be even number). Default is 10. +C is optional parametar which specify filename of L +config file. Default is C. + =cut sub new { @@ -141,6 +145,12 @@ This method will create directories if needed and store tree xml files for all indexes. +Turning debugging for this function by inserting + + log4perl.logger.WebPAC.jsFind.close=DEBUG + +into C will also result in creation of GraphViz C<.dot> files +for each index in current directory. =cut @@ -154,7 +164,17 @@ $log->debug("saving index '$index_name' xml files to '$path'"); - $self->tree($index_name)->to_jsfind($path); + $self->tree($index_name)->to_jsfind($path,'ISO-8859-2','UTF-8'); + + if ($log->is_debug()) { + my $dot_file = $index_name.".dot"; + + $log->debug("saving graphviz file for '$index_name' to '$dot_file'"); + + open(DOT, ">", $dot_file) || $log->logdie("can't open '$dot_file': $!"); + print DOT $self->tree($index_name)->to_dot; + close(DOT); + } } }