Skip to content

Commit

Permalink
ceph-volume create a logger for the terminal
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 95b16b5)
  • Loading branch information
Alfredo Deza committed Sep 10, 2019
1 parent 7c63650 commit bdf6a8b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ceph-volume/ceph_volume/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,18 @@ def setup(name='ceph-volume.log', log_path=None):
fh.setFormatter(logging.Formatter(FILE_FORMAT))

root_logger.addHandler(fh)


def setup_console():
# TODO: At some point ceph-volume should stop using the custom logger
# interface that exists in terminal.py and use the logging module to
# produce output for the terminal
# Console Logger
sh = logging.StreamHandler()
sh.setFormatter(logging.Formatter('[terminal] %(message)s'))
sh.setLevel(logging.DEBUG)

terminal_logger = logging.getLogger('terminal')

# allow all levels at root_logger, handlers control individual levels
terminal_logger.addHandler(sh)

0 comments on commit bdf6a8b

Please sign in to comment.