Don't log to stdout when log_dir is set

In addition to checking if log_file is set, we should check
for log_dir as well. Previously, If log_file is not set, oslo
will output logs to stdout even if log_dir is set. The only way
for example the Heat folks avoided logging to stdout was to
set log_file, but then all the heat processes ended up logging
to the same file. So a check for both log_dir and log_file
should avoid any output to stdout. Please note that use_stderr
should be set to false as well to avoid any output to console

Change-Id: Ie2886da679daedea0197ee3b3963ebedb8f11a0b
Closes-Bug: #1226287
Replace removed items in Python3

Built-in function xrange and type long were used in Python 2,
were removed in Python3. Python3 uses range and int. Here we use
six.moves.range and six.integer_types.

Implements: blueprint make-python3-compatible
Change-Id: I770de45f6178086abe54e2aca2b554c14c68c00e
Merge "Don't log to stdout when log_dir is set"
Merge "Replace removed items in Python3"