From: Genevieve Luyt Date: Mon, 22 Oct 2018 17:39:13 +0000 (-0400) Subject: doc: use the new log functions X-Git-Tag: go1.12beta1~697 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b917bdd3ba255cd71ec0aa837215fa296b89eb77;p=gostls13.git doc: use the new log functions 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 --- diff --git a/doc/effective_go.html b/doc/effective_go.html index 38d09f4c73..5d184b76a9 100644 --- a/doc/effective_go.html +++ b/doc/effective_go.html @@ -2762,7 +2762,7 @@ type Job struct { }

-The Job type now has the Log, Logf +The Job type now has the Print, Printf, Println and other methods of *log.Logger. We could have given the Logger 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 Job:

-job.Log("starting now...")
+job.Println("starting now...")
 

The Logger is a regular field of the Job struct, @@ -2797,8 +2797,8 @@ we would write job.Logger, which would be useful if we wanted to refine the methods of Logger.

-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...))
 }