]> Cypherpunks repositories - gostls13.git/commitdiff
doc: use the new log functions
authorGenevieve Luyt <genevieve.luyt@gmail.com>
Mon, 22 Oct 2018 17:39:13 +0000 (13:39 -0400)
committerRob Pike <r@golang.org>
Mon, 22 Oct 2018 19:57:05 +0000 (19:57 +0000)
The log interface was changed in https://golang.org/cl/2419042.

Change-Id: I3eaddd8a5cfcae961db16555fb1b0ce6770b6334
Reviewed-on: https://go-review.googlesource.com/c/143777
Reviewed-by: Rob Pike <r@golang.org>
doc/effective_go.html

index 38d09f4c73e0c243739158ed1d945f038d43b48b..5d184b76a9d84349244526f436c5585d909a895c 100644 (file)
@@ -2762,7 +2762,7 @@ type Job struct {
 }
 </pre>
 <p>
-The <code>Job</code> type now has the <code>Log</code>, <code>Logf</code>
+The <code>Job</code> type now has the <code>Print</code>, <code>Printf</code>, <code>Println</code>
 and other
 methods of <code>*log.Logger</code>.  We could have given the <code>Logger</code>
 a field name, of course, but it's not necessary to do so.  And now, once
@@ -2770,7 +2770,7 @@ initialized, we can
 log to the <code>Job</code>:
 </p>
 <pre>
-job.Log("starting now...")
+job.Println("starting now...")
 </pre>
 <p>
 The <code>Logger</code> is a regular field of the <code>Job</code> struct,
@@ -2797,8 +2797,8 @@ we would write <code>job.Logger</code>,
 which would be useful if we wanted to refine the methods of <code>Logger</code>.
 </p>
 <pre>
-func (job *Job) Logf(format string, args ...interface{}) {
-    job.Logger.Logf("%q: %s", job.Command, fmt.Sprintf(format, args...))
+func (job *Job) Printf(format string, args ...interface{}) {
+    job.Logger.Printf("%q: %s", job.Command, fmt.Sprintf(format, args...))
 }
 </pre>
 <p>