You want to log what the parameters are that a method receives at the method start (and end)
To log the input values, you can pass in a formatted string to SimpleLogger.use_markers.
Here is an example:
def method_with_inputs(number, name):
with SimpleLogger.use_markers(f"number = {number}, name = {name}"):
It will produce:
-> in: method_with_inputs(number = 1, name = Susan) in test_simple_logger
<- out: method_with_inputs()
To log the values at both entrance to the method and exit from the method, you can pass in a formatted string in a lambda.
Here is an example:
def method_with_inputs_and_outputs(number, announcement):
with SimpleLogger.use_markers(
lambda: f"number = {number}, announcement = {announcement}"
):
It will produce:
-> in: method_with_inputs_and_outputs(number = 10, announcement = Blast off) in test_simple_logger
<- out: method_with_inputs_and_outputs(number = 1, announcement = Blast off)