logging

diff --git a/coders/png.c b/coders/png.c
index bbdc326..ef561df 100644
--- a/coders/png.c
+++ b/coders/png.c
@@ -7741,7 +7741,7 @@
                 quantum_info,GrayQuantum,png_pixels,&image->exception);
             else if (ping_color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
               {
-                if (y == 0)
+                if (logging && y == 0)
                   (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                        "  Writing GRAY_ALPHA PNG pixels (4)");
                 (void) ExportQuantumPixels(image,(const CacheView *) NULL,
@@ -7750,7 +7750,7 @@
             else
               (void) ExportQuantumPixels(image,(const CacheView *) NULL,
                 quantum_info,IndexQuantum,png_pixels,&image->exception);
-            if (y == 0)
+            if (logging && y == 0)
               (void) LogMagickEvent(CoderEvent,GetMagickModule(),
                   "  Writing row of pixels (4)");
             png_write_row(ping,png_pixels);