Index: main/trunk/greenstone2/perllib/gssql.pm
===================================================================
--- main/trunk/greenstone2/perllib/gssql.pm	(revision 32559)
+++ main/trunk/greenstone2/perllib/gssql.pm	(revision 32560)
@@ -67,4 +67,5 @@
     my $self = {
 	'collection_name' => $params_map->{'collection_name'},
+	'verbosity' => $params_map->{'verbosity'} || 1
     };
 
@@ -132,8 +133,10 @@
     my $connect_str = "dbi:$db_driver:host=$db_host"; # don't provide db - allows checking the db exists later when loading the db
 
-    print STDERR "Away to make connection to $db_driver database with:\n";
-    print STDERR " - hostname $db_host; username: $db_user";
-    print STDERR "; and the password provided" if $db_pwd;
-    print STDERR "\nAssuming the mysql server has been started with: --character_set_server=utf8mb4\n" if $db_driver eq "mysql";
+    if($self->{'verbosity'}) {
+	print STDERR "Away to make connection to $db_driver database with:\n";
+	print STDERR " - hostname $db_host; username: $db_user";
+	print STDERR "; and the password provided" if $db_pwd;
+	print STDERR "\nAssuming the mysql server has been started with: --character_set_server=utf8mb4\n" if $db_driver eq "mysql";
+    }
     
     my $dbh = DBI->connect("$connect_str", $db_user, $db_pwd,
@@ -195,5 +198,5 @@
     my $dbh = $self->{'db_handle'};
     
-    print STDERR "Attempting to use database $db_name\n";
+    print STDERR "Attempting to use database $db_name\n" if($self->{'verbosity'});
     
     # perl DBI switch database: https://www.perlmonks.org/?node_id=995434
@@ -204,10 +207,10 @@
     if(!$success && $dbh->err == 1049) { # "Unknown database" error has code 1049 (mysql only?) meaning db doesn't exist yet
 
-	print STDERR "Database $db_name didn't exist, creating it and tables for the current collection...\n";
+	print STDERR "Database $db_name didn't exist, creating it and the tables for the current collection...\n" if($self->{'verbosity'});
 	
 	# attempt to create the db and its tables
 	$self->create_db($db_name) || return 0;
 
-	print STDERR "   Created database $db_name\n";
+	print STDERR "   Created database $db_name\n" if($self->{'verbosity'} > 1);
 	
 	# once more attempt to use db, now that it exists
@@ -224,5 +227,5 @@
 	# before proceeding check that the current collection's tables exist
 
-	print STDERR "@@@ DATABASE $db_name EXISTED\n";
+	print STDERR "@@@ DATABASE $db_name EXISTED\n" if($self->{'verbosity'} > 2);
 	
 
@@ -230,5 +233,5 @@
 	# deleting the existing tables for this collection and recreating empty ones
 	if($build_mode eq "removeold") {
-	    print STDERR "   Building with removeold option set, so deleting current collection's tables if they exist\n";
+	    print STDERR "   Building with removeold option set, so deleting current collection's tables if they exist\n" if($self->{'verbosity'});
 	    $self->delete_collection_tables();
 	}
@@ -239,10 +242,10 @@
 	    $self->create_metadata_table() || return 0;
 	} else {
-	    print STDERR "@@@ Meta table exists\n";
+	    print STDERR "@@@ Meta table exists\n" if($self->{'verbosity'} > 2);
 	}
 	if($build_mode eq "removeold" || !$self->table_exists($self->get_fulltext_table_name())) {
 	    $self->create_fulltext_table() || return 0;
 	} else {
-	    print STDERR "@@@ Fulltxt table exists\n";
+	    print STDERR "@@@ Fulltxt table exists\n" if($self->{'verbosity'} > 2);
 	}
 	
@@ -263,5 +266,5 @@
     my $dbh = $self->{'db_handle'};
 
-    print STDERR "Loading database $db_name\n";
+    print STDERR "Loading database $db_name\n" if($self->{'verbosity'} > 1);
     
     # perl DBI switch database: https://www.perlmonks.org/?node_id=995434
@@ -286,5 +289,5 @@
     #$txt_sth->finish() if($txt_sth);
 
-    print STDERR "Disconnecting from database\n";
+    print STDERR "Disconnecting from database\n" if($self->{'verbosity'} > 1);
     
     my $rc = $dbh->disconnect or warn $dbh->errstr; # The handle is of little use after disconnecting. Possibly PrintError already prints a warning and this duplicates it?
@@ -307,5 +310,5 @@
     
     my $table_name = $self->get_metadata_table_name();
-    print STDERR "   Creating table $table_name\n";
+    print STDERR "   Creating table $table_name\n" if($self->{'verbosity'} > 1);
     
     # If using an auto incremented primary key:
@@ -323,5 +326,5 @@
     
     my $table_name = $self->get_fulltext_table_name();
-    print STDERR "   Creating table $table_name\n";
+    print STDERR "   Creating table $table_name\n" if($self->{'verbosity'} > 1);
     
     # If using an auto incremented primary key:
@@ -356,5 +359,5 @@
     my $dbh = $self->{'db_handle'};
 
-    print STDERR "!!! Deleting database $db_name\n";
+    print STDERR "!!! Deleting database $db_name\n" if($self->{'verbosity'});
     
     # "drop database dbname"
@@ -394,5 +397,5 @@
     my $sth = $dbh->prepare(qq{INSERT INTO $tablename (did, sid, metaname, metavalue) VALUES (?, ?, ?, ?)}) || warn("Could not prepare insert statement for metadata table\n");
 
-    print STDERR "@@@@ Prepared meta insert statement: ".$sth->{'Statement'}."\n";
+    print STDERR "@@@@ Prepared meta insert statement: ".$sth->{'Statement'}."\n" if($self->{'verbosity'} > 2);
     
     return $sth;
@@ -412,5 +415,5 @@
     my $sth = $dbh->prepare(qq{INSERT INTO $tablename (did, sid, fulltxt) VALUES (?, ?, ?)}) || warn("Could not prepare insert statement for fulltxt table\n");
     
-    print STDERR "@@@@ Prepared fulltext insert statement: ".$sth->{'Statement'}."\n";
+    print STDERR "@@@@ Prepared fulltext insert statement: ".$sth->{'Statement'}."\n" if($self->{'verbosity'} > 2);
     
     return $sth;
Index: main/trunk/greenstone2/perllib/plugins/GreenstoneSQLPlugin.pm
===================================================================
--- main/trunk/greenstone2/perllib/plugins/GreenstoneSQLPlugin.pm	(revision 32559)
+++ main/trunk/greenstone2/perllib/plugins/GreenstoneSQLPlugin.pm	(revision 32560)
@@ -374,5 +374,6 @@
     # collection name will be used for naming tables (site name will be used for naming database)
     my $gs_sql = new gssql({
-	'collection_name' => $ENV{'GSDLCOLLECTION'}
+	'collection_name' => $ENV{'GSDLCOLLECTION'},
+	'verbosity' => $self->{'verbosity'}
 			   });
 
Index: main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm
===================================================================
--- main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm	(revision 32559)
+++ main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm	(revision 32560)
@@ -141,5 +141,6 @@
 
     my $db_params = {
-	'collection_name' => $ENV{'GSDLCOLLECTION'}	
+	'collection_name' => $ENV{'GSDLCOLLECTION'},
+	'verbosity' => 1	
     };
 
