shill; Create Error::LogMessage utility routine

This combines a LOG(ERROR) with an error->Populate().  It has
the downside of having the error originate from error.cc, as
opposed to the orignal call site of the error, so readers of
the log need to rely on the content of the error message to
tell where the error came from.

BUG=chromium-os:22426
TEST=Rerun unit tests, look at all error messages

Change-Id: I9ccd5385db7c4eda34eb242abd02c57c899d161c
Reviewed-on: https://gerrit.chromium.org/gerrit/11098
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/error.h b/error.h
index c1fb2b1..a8159a0 100644
--- a/error.h
+++ b/error.h
@@ -62,6 +62,10 @@
   static std::string GetName(Type type);
   static std::string GetDefaultMessage(Type type);
 
+  // Log an error message.  If |error| is non-NULL, also populate it.
+  static void PopulateAndLog(Error *error, Type type,
+                             const std::string &message);
+
  private:
   struct Info {
     const char *name;  // Error type name.