refactor logging usage
This commit is contained in:
@ -5,10 +5,10 @@
|
||||
@author J. Meier
|
||||
@date 13.02.2021
|
||||
"""
|
||||
import logging
|
||||
|
||||
from tmtccmd.logging import get_console_logger
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class InputHelper:
|
||||
@ -25,7 +25,7 @@ class InputHelper:
|
||||
"""
|
||||
key = self.menu_handler()
|
||||
while key not in self.menu:
|
||||
LOGGER.info("Invalid key specified, try again.")
|
||||
_LOGGER.info("Invalid key specified, try again.")
|
||||
key = self.menu_handler()
|
||||
return key
|
||||
|
||||
@ -36,11 +36,11 @@ class InputHelper:
|
||||
separator_string = separator_width * "-"
|
||||
key_string = "Key".ljust(key_column_width)
|
||||
description_string = "Description".ljust(description_column_width)
|
||||
LOGGER.info(f"{key_string} | {description_string}")
|
||||
LOGGER.info(separator_string)
|
||||
_LOGGER.info(f"{key_string} | {description_string}")
|
||||
_LOGGER.info(separator_string)
|
||||
for key in self.menu:
|
||||
key_string = key.ljust(key_column_width)
|
||||
description_string = self.menu[key][0].ljust(description_column_width)
|
||||
LOGGER.info(f"{key_string} | {description_string}")
|
||||
_LOGGER.info(f"{key_string} | {description_string}")
|
||||
key = input("Specify key: ")
|
||||
return key
|
||||
|
Reference in New Issue
Block a user