I am using a simple logger for my Python app:
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
# Console handler with DEBUG level
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.DEBUG)
console_formatter = logging.Formatter('%(levelname)s: %(message)s')
console_handler.setFormatter(console_formatter)
logger.addHandler(console_handler)
I encountered a situation where I got an error when someone tried to save to the database a number that was outside of the INT range.
psycopg2.errors.NumericValueOutOfRange: integer out of range
Because I have many integer columns in this database table, it would help me with debugging to know what value caused this error. How do I add these values to the traceback?