}
</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
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,
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>