PATCH: clean up verbose logging in diff proc

Ben Elliston <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <[email protected]>
The diff proc was calling verbose and then send_log, presumably from
before verbose got the -log option in 1995.  This collapses those into
single calls to verbose -log.  The newlines appended to the strings
are not necessary and lead to unnecessary whitespace in the log file.
Committed to trunk.

Cheers, Ben

2016-02-20  Ben Elliston  <[email protected]>

	    * lib/utils.exp (diff): Replace calls to verbose followed by
	    send_log with a single call to verbose -log. Remove additional
	    newlines from the log messages.

diff --git a/lib/utils.exp b/lib/utils.exp
index fccb7e6..314fc2f 100644
--- a/lib/utils.exp
+++ b/lib/utils.exp
@@ -256,7 +256,7 @@ proc diff { file_1 file_2 } {
        return 0
     }
 
-    verbose "# Diff'ing: ${file_1} ${file_2}\n" 1
+    verbose "# Diff'ing: ${file_1} ${file_2}" 1
 
     set list_a ""
     while { [gets ${file_a} line] != ${eof} } {
@@ -281,17 +281,10 @@ proc diff { file_1 file_2 } {
        set line_a [lindex ${list_a} ${i}]
        set line_b [lindex ${list_b} ${i}]
 
-       #        verbose "\t${file_1}: ${i}: ${line_a}\n" 3
-       #        verbose "\t${file_2}: ${i}: ${line_b}\n" 3
        if {[string compare ${line_a} ${line_b}]} {
-           verbose "line #${i}\n" 2
-           verbose "\< ${line_a}\n" 2
-           verbose "\> ${line_b}\n" 2
-
-           send_log "line #${i}\n"
-           send_log "\< ${line_a}\n"
-           send_log "\> ${line_b}\n"
-
+           verbose -log "line #${i}" 2
+           verbose -log "\< ${line_a}" 2
+           verbose -log "\> ${line_b}" 2
            set differences -1
        }
     }

_______________________________________________
DejaGnu mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/dejagnu
signature.asc (application/pgp-signature, 811 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIVAwUBVsgeCnY2KIi1WYjUAQjJ5xAAnTHnoHuQ7VO+c9JPAz9vW3M/1/LnCMse
8PcpQdp5zHTYCcUhKSfqPKeldME59HPVcB2IJfMaSDA24fxwqZgfLJOZmFLiqI3M
k33GhSUTwe7zit6lx6ma64+cyeTFB/R05Ss/uB8ssdRLoQccVqK9F3hjs54SGgUJ
6tzoMgN/4TJYXrOj3pu4gDtRWrzs57HhMi3jLppL6gVhuvzKOosNtp0M/JbShAht
mKya9b9XaQR670rhQHEoCGw+JLPSOpLJ2IDSHY5YKzvn5ul0j2MJu0QSm2rGBwbS
Dy9dbYE8AOWLjgrYllIyTCMs9IYfC7zaZ6PXWkhM/5iOxcqDA/OfstZjMD8yUZRn
h+41MEi+MCPbpGrm0v0hWo8Xt6tbziybdaG0s023my6SBS/BH3h7g2l55JAmMkU2
lVjbBbJ0kLMWgzdzF3RhUK0hOdgRgVxCg6j04LPeJgyWIHVebtz2oBcljYzlKrBV
Ng3KZQhRsCi5FI8nuIFbm9nMg/oKP0X5j+zxIjd38u76RUZTsDgJt1MtpH3ce9hG
bjqF3ZHnkN6sEf+YUR0hcvSQZ/74JFdNwlUWndRjTIHoC9rZ80mTpWPlkksnmBZ0
Ufo1UQpfQKow4rqp18dkC8yQ4s73M6KIidHhWe0iSzMpmmAq28COw9f3fRX1letn
Z2VEtmr95o4=
=IL4z
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.