Change debug printing to log filename
authorDaniel Gustafsson <[email protected]>
Sun, 7 Apr 2024 22:24:20 +0000 (00:24 +0200)
committerDaniel Gustafsson <[email protected]>
Sun, 7 Apr 2024 22:24:20 +0000 (00:24 +0200)
When restarting the cluster fails the code introduced in 33774978c78
printed the full log contents to aid debugging.  For cases when the
logfile is large this adds unnecessary overhead.  Reduce to printing
the logfile path instead.

Reported-by: Andres Freund <[email protected]>
Discussion: https://postgr.es/m/20240406214439[email protected]

src/test/perl/PostgreSQL/Test/Cluster.pm

index 54e1008ae58baaf09e4c606b8e3e0373e9836251..9b2879c145c29426b80bb5bcca8ef1ad756d3bd6 100644 (file)
@@ -951,8 +951,8 @@ sub start
 
    if ($ret != 0)
    {
-       print "# pg_ctl start failed; logfile:\n";
-       print PostgreSQL::Test::Utils::slurp_file($self->logfile);
+       print "# pg_ctl start failed; see logfile for details: "
+         . $self->logfile . "\n";
 
        # pg_ctl could have timed out, so check to see if there's a pid file;
        # otherwise our END block will fail to shut down the new postmaster.
@@ -1090,8 +1090,8 @@ sub restart
 
    if ($ret != 0)
    {
-       print "# pg_ctl restart failed; logfile:\n";
-       print PostgreSQL::Test::Utils::slurp_file($self->logfile);
+       print "# pg_ctl restart failed; see logfile for details: "
+         . $self->logfile . "\n";
 
        # pg_ctl could have timed out, so check to see if there's a pid file;
        # otherwise our END block will fail to shut down the new postmaster.