How to log variables and track their values during execution?

81 views

How to log variables and track their values during execution?

How to log variables and track their values during execution?

solveurit24@gmail.com Changed status to publish February 13, 2025
0

Use logging module to print variable values.

import logging

logging.basicConfig(level=logging.INFO)
x = 100
logging.info(f"Value of x: {x}")

solveurit24@gmail.com Changed status to publish February 13, 2025
0