title: When to use log over fmt for debugging and printing error?
body: <p>I know that we can print variable or error using <code>log</code> and <code>fmt</code>. for example if I want to print variable I can do this :</p>
  
  <pre><code>h := "world"
  fmt.Printf("hello = %v\n", h)
  log.Printf("halo = %v\n", h)
  </code></pre>
  
  <p>the output would be :</p>
  
  <pre><code>hello = world
  2016/12/30 09:13:12 halo = world
  </code></pre>
  
  <p>and usually in the error handling I found log like this </p>
  
  <pre><code>if err != nil {
      log.Println("Error : something terrible happen -&gt; ", err)
      return err
  }
  </code></pre>
  
  <p>but from above case I could also use <code>fmt</code> to print the error like this </p>
  
  <pre><code>fmt.Printf("Error : something terrible happen -&gt; %v\n",err.Error())
  </code></pre>
  
  <p>Is it a good practice to use <code>fmt</code> instead of <code>log</code> for printing the error?
  And then I always use <code>fmt</code> instead of <code>log</code> for printing the variable when debugging.</p>