Sync log.py from oslo-incubator

We want to pick up change 55cd46af to avoid thousands of blank lines in
the nova logs, so sync log.py over to nova.

This includes the following changes:

  55cd46a remove extra newlines that eventlet seems to add
  d292f7d Add error type to unhandled exception log message
  0228b81 Logging excepthook: print exception info if debug=True
  71208fe Fix spelling errors in comments
  8b2b0b7 Use hacking import_exceptions for gettextutils._
  6d0a6c3 Correct invalid docstrings
  fe18bfa Remove keystone from default_log_levels default
  27b21bc Unify different names between Python2/3 with six.moves
  12bcdb7 Remove vim header
  a6f40ac Don't log to stdout when log_dir is set

Note that change 13eb01c "Adding domain to context and log" was
intentionally ommitted since it requires context.py to be synced and
changes nova.conf.sample, but nova uses it's own context module so we
don't want that change pulled in here.

Change-Id: Iebfdf484b9fcac5dbb689c4f7ec4f43a082a50c9
Merge "Sync log.py from oslo-incubator"