Changeset 32576


Ignore:
Timestamp:
2018-11-06T15:27:57+13:00 (3 years ago)
Author:
ak19
Message:

Tested CSVPlugin. Some helpful debug statements are logged to STDERR by gssql when writing out stuff to the DB if GS SQL Plugout explicitly sets verbosity at 3 or higher

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/gssql.pm

    r32575 r32576  
    388388    if($debug_only) {
    389389    # just print the statement we were going to execute
     390    print $debug_out $sth->{'Statement'} . "($doc_oid, $section_name, $meta_name, $escaped_meta_value)\n";
     391    }
     392    else {
     393    print STDERR $sth->{'Statement'} . "($doc_oid, $section_name, $meta_name, $escaped_meta_value)\n" if $self->{'verbosity'} > 2;
    390394   
    391     print $debug_out $sth->{'Statement'} . "($doc_oid, $section_name, $meta_name, $escaped_meta_value)\n";
    392     } else {
    393395    $sth->execute($doc_oid, $section_name, $meta_name, $escaped_meta_value)
    394396        || warn ("Unable to write metadata row to db:\n\tOID $doc_oid, section $section_name,\n\tmeta name: $meta_name, val: $escaped_meta_value");
     
    411413    # Now we're ready to execute the command, unless we're only debugging
    412414
     415    # just print the statement we were going to execute, minus the fulltxt value
     416    my $txt_repr = $$section_textref ? "<TXT>" : "NULL";   
    413417    if($debug_only) {
    414     # just print the statement we were going to execute, minus the fulltxt value
    415     my $txt_repr = $$section_textref ? "<TXT>" : "NULL";
    416418    print $debug_out $sth->{'Statement'} . "($doc_oid, $section_name, $txt_repr)\n";
    417     } else {
     419    }
     420    else { 
     421    print STDERR $sth->{'Statement'} . "($doc_oid, $section_name, $txt_repr)\n" if $self->{'verbosity'} > 2;
     422   
    418423    $sth->execute($doc_oid, $section_name, $$section_textref)
    419424        || warn ("Unable to write fulltxt row to db for row:\n\tOID $doc_oid, section $section_name");
Note: See TracChangeset for help on using the changeset viewer.