0

I am developping a python application and I would like to include a very detailed stack info in case of exceptions, including all local variables. This is what is done in Django

I have set up the Python (in Python 3) log and with logger.debug (' error in knitting ',exc_info = True, stack_info = True, extra = dicte) I get the stack trace but not the list of internal variables and their content. How can I do this?

what I would like to get is th following:

▼ Local vars Variable Value args

()

kwargs

{'tech_number': 108}

name

'get'

self

1
  • Could you please give an extended example of the input/output you are expecting? Commented Apr 21, 2019 at 23:00

1 Answer 1

0

I don't really understand your question. But I think you could put whatever you want into extra as a python dict. Then you need

  1. overwrite your record.message in function format
  2. set format to your logger

Here is part of the code as example Link

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.