title: What are the best practices to log an error?
body: <p>Many times I saw logging of errors like these:</p>
  
  <pre><code>System.out.println("Method aMethod with parameters a:"+a+" b: "+b);
  print("Error in line 88");
  </code></pre>
  
  <p>so.. What are the best practices to log an error?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This is java but could be C/C++, basic, etc.</p>