🔊 add some logs
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import logging
|
||||
import os
|
||||
from enum import Enum
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Action(Enum):
|
||||
PIECE_SUIVANTE = (1, "Pièce suivante")
|
||||
@@ -26,6 +29,10 @@ def action_menu(actions_autorisees: list[Action] = None) -> Action:
|
||||
|
||||
actions_autorisees = list(Action) if actions_autorisees is None else actions_autorisees
|
||||
|
||||
logger.debug('Show action menu')
|
||||
for action in actions_autorisees:
|
||||
logger.debug('Action %s - "%s"', action.code, action.libelle)
|
||||
|
||||
while True:
|
||||
print("\n------ Menu Action ------\n")
|
||||
|
||||
@@ -37,9 +44,12 @@ def action_menu(actions_autorisees: list[Action] = None) -> Action:
|
||||
clear_console()
|
||||
for action in actions_autorisees:
|
||||
if action.code == choix:
|
||||
logger.info('User selected action %s - "%s"', action.code, action.libelle)
|
||||
return action
|
||||
|
||||
print("Mauvais choix")
|
||||
except ValueError:
|
||||
clear_console()
|
||||
print("Veuillez saisir un nombre.")
|
||||
|
||||
logger.info('Bad input')
|
||||
|
||||
Reference in New Issue
Block a user