ceph-disk: display the function name with the log messages

Signed-off-by: Loic Dachary <loic@dachary.org>
This commit is contained in:
Loic Dachary 2016-02-23 17:09:14 +07:00
parent 155a53d649
commit 0186062d29

View File

@ -4559,13 +4559,14 @@ def setup_logging(verbose, log_stdout):
if log_stdout:
ch = logging.StreamHandler(stream=sys.stdout)
ch.setLevel(loglevel)
formatter = logging.Formatter('%(filename)s: %(message)s')
formatter = logging.Formatter('%(funcName)s: %(message)s')
ch.setFormatter(formatter)
LOG.addHandler(ch)
LOG.setLevel(loglevel)
else:
logging.basicConfig(
level=loglevel,
format='%(funcName)s: %(message)s',
)