Skip to content

Commit

Permalink
doc: use the new log functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
genevieveluyt authored and robpike committed Oct 22, 2018
1 parent ddf83ee commit b917bdd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/effective_go.html
Expand Up @@ -2762,15 +2762,15 @@ <h2 id="embedding">Embedding</h2>
}
</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
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,
Expand All @@ -2797,8 +2797,8 @@ <h2 id="embedding">Embedding</h2>
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>
Expand Down

0 comments on commit b917bdd

Please sign in to comment.