🔊 Add logging events Info & Debug

relate to forga/process/fr/embarquement#6
This commit is contained in:
freezed 2021-04-18 22:55:31 +02:00
parent 1159d4b189
commit f00187f4ea
1 changed files with 5 additions and 1 deletions

View File

@ -12,8 +12,11 @@ The goal is to build durable python script using standard library
This script compute the greater common divisor of 2 integrers
"""
import logging
# MESSAGES
FUNCTION_CALL = "Function is called"
SUBSTRACTION_MADE = "Substraction made"
WRONG_INPUT_ORDER = "Inputs in ascending order"
@ -32,10 +35,12 @@ def pgcd(input_a, input_b):
>>> pgcd(910, 42)
14
"""
logging.info(FUNCTION_CALL)
rest = input_a - input_b
check = input_b - rest
while check != 0:
logging.debug(SUBSTRACTION_MADE)
input_a = max(input_b, rest)
input_b = min(input_b, rest)
rest = input_a - input_b
@ -53,7 +58,6 @@ if __name__ == "__main__":
# ARGUMENTS, PARAMETERS & OPTIONS
import argparse
import logging
import sys
PARSER = argparse.ArgumentParser(