Using something like this:
try:
# Something...
except Exception as excep:
logger = logging.getLogger("component")
logger.warning("something raised an exception: " + excep)
logger.info("something raised an exception: " + excep)
I would rather not have it on the error-level cause in my special case it is not an error.
Here is one that works (python 2.6.5).
From the logging documentation:
So do:
Try using Logger.exception.
You can try this:
I was able to display log messages in a exception block with the following code snippet:
Use
Logger.exception()
.